Skip to content

[push] route FCM sends by device token type - #289

Open
capcom6 wants to merge 4 commits into
masterfrom
push/fid-target
Open

capcom6 wants to merge 4 commits into
masterfrom
push/fid-target

Conversation

@capcom6

@capcom6 capcom6 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Routes FCM pushes by the device's stored push-token type: Firebase Installation IDs use Message.Fid, while legacy registration tokens keep using Message.Token.

  • Extends the client-go upstream push contract with an optional pushTokenType and pins the new version.
  • Carries the stored type through the private-gateway upstream path; omitted types stay legacy-compatible.
  • Normalizes legacy "" and "token" to one cache/blacklist key so debounce and failed-token protection are shared.
  • Sets state: Active on device DTOs for the new client-go DeviceState field.

Verification: go build ./..., go vet ./..., golangci-lint run (0 issues) and make test pass in this repo; client-go make lint and make test pass on the new DTO.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous findings are addressed and no new blocking issue was found.

Summary

The PR carries each device’s push-token type through storage, the queue, upstream forwarding, and FCM.

  • Push sends now choose the FCM target from each token’s type.
  • Device registration and updates now save each push token’s type.
  • Device responses now mark returned devices as active.

The review checked source code only; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Device[Saved device token and type] --> Queue[Push queue]
  Queue --> Mode{Push mode}
  Mode -->|Direct| FCM{Token type}
  Mode -->|Upstream| Forward[Forward token and type]
  Forward --> Receive[Upstream handler]
  Receive --> PublicQueue[Public push queue]
  PublicQueue --> FCM
  FCM -->|fid| Fid[FCM Fid]
  FCM -->|Legacy or omitted| Token[FCM Token]
Loading

Reviews (3) · Last reviewed commit: "[push] normalize legacy token type in ca..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 774221d3-9687-440f-a954-fedfdbbb1842

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🤖 Pull request artifacts

Platform File
🐳 Docker GitHub Container Registry
🍎 Darwin arm64 server_Darwin_arm64.tar.gz
🍎 Darwin x86_64 server_Darwin_x86_64.tar.gz
🐧 Linux arm64 server_Linux_arm64.tar.gz
🐧 Linux i386 server_Linux_i386.tar.gz
🐧 Linux x86_64 server_Linux_x86_64.tar.gz
🪟 Windows arm64 server_Windows_arm64.zip
🪟 Windows i386 server_Windows_i386.zip
🪟 Windows x86_64 server_Windows_x86_64.zip

This branch has not been deployed

No deployments
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