Skip to content

feat: Add support for notification push type widgets#194

Open
dwrss wants to merge 3 commits intoparse-community:masterfrom
Snailed-It:add-widgets-to-NotificationPushType
Open

feat: Add support for notification push type widgets#194
dwrss wants to merge 3 commits intoparse-community:masterfrom
Snailed-It:add-widgets-to-NotificationPushType

Conversation

@dwrss
Copy link
Copy Markdown

@dwrss dwrss commented Jan 7, 2026

As per Apple's documentation "widgets" is now a valid push type: https://developer.apple.com/documentation/widgetkit/updating-widgets-with-widgetkit-push-notifications

Summary by CodeRabbit

  • New Features

    • Added support for a new "widgets" notification type.
    • Added a public "content changed" flag for notifications; enabling it includes the corresponding APS field in outgoing payloads and provides a chainable setter.
  • Tests

    • Added tests validating the content-changed flag’s default omission, setting behavior (true/1), removal, and setter chaining.

@parse-github-assistant
Copy link
Copy Markdown

parse-github-assistant bot commented Jan 7, 2026

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 7, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9dad0b2-a413-47c6-a820-91cc078c3aad

📥 Commits

Reviewing files that changed from the base of the PR and between 29c6a90 and 29d1ec4.

📒 Files selected for processing (4)
  • index.d.ts
  • lib/notification/apsProperties.js
  • lib/notification/index.js
  • test/notification/apsProperties.js
✅ Files skipped from review due to trivial changes (1)
  • test/notification/apsProperties.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/notification/index.js
  • lib/notification/apsProperties.js
  • index.d.ts

📝 Walkthrough

Walkthrough

Adds APS support for a "content-changed" flag: TypeScript typings extended, runtime APS setter added, a generated chainable setContentChanged on Notification, and unit tests; also adds 'widgets' to the exported NotificationPushType union.

Changes

Cohort / File(s) Summary
Type definitions
index.d.ts
Added optional `"content-changed"?: undefined
APS runtime property
lib/notification/apsProperties.js
Added exported contentChanged setter: sets this.aps['content-changed'] = true when input is true or 1, otherwise clears the field (undefined).
Notification API
lib/notification/index.js
Added contentChanged to the auto-generated properties list so Notification.prototype gains a chainable setContentChanged(value) setter.
Tests
test/notification/apsProperties.js
Added tests verifying omission by default, true and 1 normalize to aps.content-changed: true, clearing via undefined, and that setContentChanged(true) is chainable and produces the expected compiled payload.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title begins with the 'feat:' prefix as required and accurately summarizes the main change: adding support for the 'widgets' notification push type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed The new contentChanged setter implementation follows defensive programming patterns with strict equality comparisons, and adding 'widgets' to NotificationPushType is a safe type definition change.
Engage In Review Feedback ✅ Passed The PR contains 3 clean commits with clear messages and only an automated Snyk security check that passed with no findings. No human reviewer feedback comments requiring engagement or remediation were documented.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@parseplatformorg
Copy link
Copy Markdown

parseplatformorg commented Jan 7, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @index.d.ts:
- Line 270: The union type NotificationPushType includes an invalid value
'widgets'; remove 'widgets' from the NotificationPushType declaration so the
type union matches Apple APNs valid push types (alert, background, location,
voip, complication, fileprovider, mdm, liveactivity, pushtotalk). Also audit the
code that sets the apns-push-type header (the logic around pushType usage in
lib/notification/index.js) and, if needed, add validation to reject or map
unsupported values before sending to APNs so only documented types are allowed.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c49e689 and 4075937.

📒 Files selected for processing (1)
  • index.d.ts

@dwrss dwrss changed the title Add 'widgets' to NotificationPushType feat: Allow 'widgets' in NotificationPushType Jan 8, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 8, 2026
Copy link
Copy Markdown
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is missing

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.87%. Comparing base (d436b79) to head (29c6a90).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
+ Coverage   95.86%   95.87%   +0.01%     
==========================================
  Files          23       23              
  Lines         846      849       +3     
==========================================
+ Hits          811      814       +3     
  Misses         35       35              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtrezza mtrezza changed the title feat: Allow 'widgets' in NotificationPushType feat: Add support for notification push type widgets Mar 31, 2026
@dwrss dwrss force-pushed the add-widgets-to-NotificationPushType branch from d102112 to d059556 Compare April 1, 2026 22:53
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@index.d.ts`:
- Around line 370-373: The declaration for contentChanged currently uses boolean
but the runtime setter (see lib/notification/apsProperties.js) treats allowed
set values as true | 1 and clears the field on undefined/other falsy values;
update the index.d.ts declaration for the public property contentChanged to
reflect the runtime contract (allow true and numeric 1 as valid set values and
undefined to clear) so TypeScript callers can express setting and clearing
correctly (locate the contentChanged property in the type/class declaration and
change its type accordingly).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7909c75-4ee3-4280-b713-64be07eabf0a

📥 Commits

Reviewing files that changed from the base of the PR and between d102112 and d059556.

📒 Files selected for processing (4)
  • index.d.ts
  • lib/notification/apsProperties.js
  • lib/notification/index.js
  • test/notification/apsProperties.js
✅ Files skipped from review due to trivial changes (2)
  • lib/notification/apsProperties.js
  • test/notification/apsProperties.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/notification/index.js

@dwrss dwrss force-pushed the add-widgets-to-NotificationPushType branch from d059556 to 29c6a90 Compare April 4, 2026 01:53
@dwrss dwrss force-pushed the add-widgets-to-NotificationPushType branch from 29c6a90 to 29d1ec4 Compare April 9, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants