Repository navigation
fix(mobile): push-token failures no longer report notifications as enabled #26557
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
+204
−9
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5980125
test(mobile): reproduce push-token failure reported as registered (#2…
juliusmarminge de889cb
fix(mobile): push-token failures no longer report notifications as re…
juliusmarminge 9ef3ffe
fix(mobile): reuse the last push token when a later lookup fails
juliusmarminge 50e6951
fix(mobile): a tokenless registration is not kept as notifications en…
juliusmarminge bc1d62c
fix(mobile): a missing push token keeps the relay registration but re…
juliusmarminge 7b0046b
fix(relay): list a device without a push token as notifications off
juliusmarminge 9d42383
Merge remote-tracking branch 'origin/main' into fix/issue-26530
juliusmarminge 2d177a5
Merge remote-tracking branch 'origin/main' into fix/issue-26530
juliusmarminge f1af7fe
Merge remote-tracking branch 'origin/main' into fix/issue-26530
juliusmarminge fe445b8
test(mobile): drop unrelated blank line from registration tests
juliusmarminge 40dae02
Merge remote-tracking branch 'origin/main' into fix/issue-26530
juliusmarminge 2799d13
fix(mobile): a token lookup that overlaps a rotation keeps the rotate…
juliusmarminge 9a995aa
fix(mobile): a tokenless device stays registered for Live Activities
juliusmarminge 2f29a14
fix(mobile): Device Notifications shows off until the relay holds a p…
juliusmarminge 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { describe, expect, it } from "@effect/vitest"; | ||
| import * as Effect from "effect/Effect"; | ||
| import * as Layer from "effect/Layer"; | ||
|
|
||
| import * as RelayDb from "../db.ts"; | ||
| import * as Devices from "./Devices.ts"; | ||
|
|
||
| const deviceRow = (pushToken: string | null) => ({ | ||
| deviceId: "device-1", | ||
| label: "Pixel 9", | ||
| platform: "android", | ||
| iosMajorVersion: null, | ||
| androidApiLevel: 36, | ||
| appVersion: "2.2.0", | ||
| pushToken, | ||
| preferences: { | ||
| notificationsEnabled: true, | ||
| liveActivitiesEnabled: true, | ||
| notifyOnApproval: true, | ||
| notifyOnInput: true, | ||
| notifyOnCompletion: true, | ||
| notifyOnFailure: true, | ||
| }, | ||
| updatedAt: "2026-10-28T00:00:00.000Z", | ||
| }); | ||
|
|
||
| describe("Devices", () => { | ||
| it.effect.each([ | ||
| [null, false], | ||
| ["fcm-token", true], | ||
| ] as const)("lists notifications for push token %s as enabled: %s", ([pushToken, enabled]) => { | ||
| const fakeDb = { | ||
| select: () => ({ | ||
| from: () => ({ where: () => Effect.succeed([deviceRow(pushToken)]) }), | ||
| }), | ||
| } as unknown as RelayDb.RelayDb["Service"]; | ||
|
|
||
| return Effect.gen(function* () { | ||
| const devices = yield* Devices.Devices; | ||
| const [device] = yield* devices.listForUser({ userId: "user-1" }); | ||
|
|
||
| expect(device?.notifications.enabled).toBe(enabled); | ||
| }).pipe( | ||
| Effect.provide(Devices.layer.pipe(Layer.provide(Layer.succeed(RelayDb.RelayDb, fakeDb)))), | ||
| ); | ||
| }); | ||
| }); |
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.
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.
This repeats the cached-token failure setup in the preference-change test. Could you fold the refresh and its assertions into that case before the preference update?
Posted via Macroscope — Test Signal