-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Release 1.0.2 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d13eece
Release 1.0.2
7ba14a8
Regenerate docs for 1.0.2
a422028
Release 1.0.2
eb72f07
refactor(examples): use PushSubscriptionChangedState event handler
fadi-george 419c2dc
chore(examples): comment out debug delay
fadi-george 6d1c7d0
ci: add pull-requests read permission to cd.yml
fadi-george File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Nit / pre-existing-style oversight:
examples/demo/src/hooks/useOneSignal.tsaddsconsole.log(\Permission changed: ${granted}`)insidepermissionHandler, but the matching change was not made inexamples/demo_pods/src/hooks/useOneSignal.tsat lines 213-215. The two example apps mirror each other in this PR (both received identicalpushSubHandler` refactors and identical 'Uncomment if you want…' comment blocks), so the missing log line in demo_pods looks like an oversight rather than intentional. No functional impact — only affects example-app debug output.Extended reasoning...
What the bug is
This PR makes a series of parallel changes to two example apps that are clearly meant to mirror each other:
examples/demo/src/hooks/useOneSignal.tsandexamples/demo_pods/src/hooks/useOneSignal.ts. In both files the PR rewritespushSubHandlerbyte-identically (the samefmtTokenhelper, the same template literal, the same destructuring ofprevious/current) and adds the same 'Uncomment if you want so you have time to see logs while trying to open safari web inspector' comment block at the top ofload(). However, the demo file also gets a newconsole.log(\Permission changed: ${granted}`)line insidepermissionHandler`, while demo_pods does not.The specific code path
In
examples/demo/src/hooks/useOneSignal.ts(around the changed lines), the handler now reads:In
examples/demo_pods/src/hooks/useOneSignal.tsat lines 213-215, the same handler instead reads:Both handlers are wired up via
OneSignal.Notifications.addEventListener('permissionChange', permissionHandler)later in the same effect, and the surrounding handlers (pushSubHandler,userChangeHandler,handleNotificationClick,handleForegroundWillDisplay, the IAM listeners) all have matchingconsole.logcalls in both files.Why existing code doesn't prevent it
These are example apps, not part of the published SDK. There is no shared module between the two demos and no test that asserts they stay in sync, so a forgotten line in one of them passes lint, type-check, and CI.
Impact
Negligible at runtime — the missing log line only changes what the developer sees in the JS console while exercising demo_pods. It does not affect plugin behavior, packaged output, or end users in any way. This is purely a consistency/debugging-ergonomics nit.
Step-by-step proof
examples/demo/src/hooks/useOneSignal.tsand findpermissionHandler— it has two statements: aconsole.logand a state setter.examples/demo_pods/src/hooks/useOneSignal.tsand findpermissionHandlerat lines 213-215 — it has only the state setter.pushSubHandleris byte-identical, including the exactPush subscription changed: id=…log message.userChangeHandleris byte-identical, including theUser changed: onesignalId=…log. The IAMwillDisplay/didDisplay/willDismiss/didDismiss/clickhandlers are all byte-identical with theirconsole.logcalls. Even theload()comment about Safari web inspector is byte-identical.permissionHandleris the single divergence — a missed parallel edit.How to fix
Add the same line to
examples/demo_pods/src/hooks/useOneSignal.tsso itspermissionHandlerreads:One-line fix, no risk.