Skip to content

feat: Web SDK update for version 28.2.0-rc.6 - #185

Merged
ArnabChatterjee20k merged 5 commits into
mainfrom
dev
Oct 7, 2026
Merged

ArnabChatterjee20k merged 5 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

This PR contains updates to the Web SDK for version 28.2.0-rc.6.

What's Changed

  • Added: Push.onNotificationOpened() fires when a user taps a shown notification
  • Added: Push.getInitialNotification() (returns null on web) and the PushNotificationOpened type
  • Added: tapping a push notification focuses then closes the page
  • Fixed: subscribe() resolves the signed-in user from cookieFallback, not just an explicit session
  • Fixed: background notifications de-duplicate by title, so each distinct title posts once
  • Updated: clearer error messages for missing credentials in push

Regenerated with sdk-generator 5.5.1.

@hansi-codes

hansi-codes Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The new notification-open event handling needs minor fixes for multiple Push instances and throwing listeners.

Updates the Web SDK to 28.2.0-rc.6 and adds notification-open callbacks, a web initial-notification API, and the exported notification-open payload type. Push authentication now supports cookie-fallback sessions, and background notifications post after subscription callbacks with deduplication by title. The analytics tracking helper and its exports from the earlier commits have been removed.

Latest changes: The newest commit bumps the release to rc.6, adds notification-tap APIs, reads cookie-fallback sessions for push authentication, deduplicates notification titles, and removes analytics tracking.

Verdict New comments Fixed Still open
✅ Approved 2 3 0
Finding Where
🟡 Scope notification-open listeners to their Push instance src/services/push.ts:32
🟡 Isolate failures in notification-open listeners src/services/push.ts:912
Fix with agent prompt
### Issue 1
src/services/push.ts:32
**Scope notification-open listeners to their Push instance**

With two Push instances on the page, tapping a notification from one invokes the other instance's listeners too, potentially routing data from a different project to the wrong handler. Please keep the listener set on the instance that creates the notification.

### Issue 2
src/services/push.ts:912
**Isolate failures in notification-open listeners**

If one listener throws, `forEach` stops and the remaining registered listeners never receive the tap; the exception also escapes onto the host page. Please catch and report errors per listener so one handler cannot block the others.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 7
File Change
CHANGELOG.md Adds release entries describing the push updates.
README.md Updates the CDN example to 28.2.0-rc.6.
package.json Bumps the SDK package version to 28.2.0-rc.6.
package-lock.json Synchronizes the locked package version with rc.6.
src/client.ts Updates the SDK version request header.
src/index.ts Exports PushNotificationOpened and removes the earlier analytics exports.
src/services/push.ts Adds notification-tap APIs, cookie-fallback authentication, and per-title notification deduplication.
✅ Fixed since the last review · 3
  • Handle rejected promises returned by the emitter · src/services/analytics-tracking.ts:241
  • Preserve the final scroll sample when throttling · src/services/analytics-tracking.ts:503
  • Use an emitter example that exists in this SDK · src/services/analytics-tracking.ts:15

Reviewed the commits since 95eb9b4 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

Comment thread src/services/analytics-tracking.ts Outdated
Comment thread src/services/analytics-tracking.ts Outdated
Comment thread src/services/analytics-tracking.ts Outdated
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Web SDK update for version 28.2.0-rc.5 feat: Web SDK update for version 28.2.0-rc.6 Oct 7, 2026

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

Comment thread src/services/push.ts
}

// Taps on the notifications this page shows, reported to every onNotificationOpened.
const openedListeners = new Set<(opened: PushNotificationOpened) => void>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Scope notification-open listeners to their Push instance

With two Push instances on the page, tapping a notification from one invokes the other instance's listeners too, potentially routing data from a different project to the wrong handler. Please keep the listener set on the instance that creates the notification.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/push.ts
Line: 32

Comment:
**Scope notification-open listeners to their Push instance**

With two Push instances on the page, tapping a notification from one invokes the other instance's listeners too, potentially routing data from a different project to the wrong handler. Please keep the listener set on the instance that creates the notification.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

Comment thread src/services/push.ts
window.focus();
notification.close();
const opened = toOpened(message.topic, message.data);
openedListeners.forEach((listener) => listener(opened));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isolate failures in notification-open listeners

If one listener throws, forEach stops and the remaining registered listeners never receive the tap; the exception also escapes onto the host page. Please catch and report errors per listener so one handler cannot block the others.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/push.ts
Line: 912

Comment:
**Isolate failures in notification-open listeners**

If one listener throws, `forEach` stops and the remaining registered listeners never receive the tap; the exception also escapes onto the host page. Please catch and report errors per listener so one handler cannot block the others.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · error-handling · Reply if this doesn't apply.

@ArnabChatterjee20k
ArnabChatterjee20k merged commit cb58a63 into main Oct 7, 2026
1 check passed
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.

1 participant