Skip to content

Allow invalidating a cached FCM registration without an apiKey change - #10

Open
phumpal wants to merge 1 commit into
masterfrom
SCA-1248
Open

phumpal wants to merge 1 commit into
masterfrom
SCA-1248

Conversation

@phumpal

@phumpal phumpal commented Sep 15, 2026

Copy link
Copy Markdown

What's changed?

The native FCM registration cache is refreshed only when credentials are missing or firebase.apiKey changes. If a stored token is later rejected with FCM SENDER_ID_MISMATCH the client otherwise reuses it indefinitely. Reload and secondSTART_NOTIFICATION_SERVICE receive the same cached token.

This adds INVALIDATE_REGISTRATION via ipcMain.handle. The renderer can await clearing the cached registration state (credentials, fcmApiKey and started) and destroying the MCS client. The next START_NOTIFICATION_SERVICE then calls register() and mints a fresh token.

Why ipcMain.handle?

This must be request/response rather than fire-and-forget. The caller invalidates the registration and immediately starts the notification service. With ipcMain.on / send, the start can race ahead of invalidation, hit the started === true early return and re-upload the rejected token.

Bumps package version to 2.1.10.

@phumpal
phumpal force-pushed the SCA-1248 branch 2 times, most recently from aa9ca56 to 3b5837a Compare September 15, 2026 04:54
@superhuman superhuman deleted a comment from linear-code Bot Sep 15, 2026
@phumpal
phumpal marked this pull request as ready for review September 15, 2026 04:57
The cache only remints when credentials are missing or firebase.apiKey
changes. INVALIDATE_REGISTRATION is ipcMain.handle so the caller can
await the drop before START_NOTIFICATION_SERVICE.

Bump to 2.1.10.
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