Skip to content

Track topic subscriptions locally#302

Open
xtrinch wants to merge 13 commits into
masterfrom
feature/topic-subscription-tracking
Open

Track topic subscriptions locally#302
xtrinch wants to merge 13 commits into
masterfrom
feature/topic-subscription-tracking

Conversation

@xtrinch
Copy link
Copy Markdown
Owner

@xtrinch xtrinch commented Apr 7, 2026

Summary

Add optional local topic subscription tracking so Django can query topic memberships for devices managed through fcm-django.

Why

Firebase's Admin SDK supports subscribing and unsubscribing registration tokens to topics, but it does not expose an API to list topic memberships for a token. This package therefore had no way to answer the request from discussion #263.

What changed

  • add TRACK_TOPIC_SUBSCRIPTIONS setting
  • add FCMDeviceTopic model and migration
  • sync local topic membership on successful subscribe/unsubscribe calls made through fcm-django
  • add queryset and instance helpers for reading tracked topic memberships
  • document the local-tracking limitation and add test coverage for default and swapped device models

Impact

Projects can opt into local topic tracking and query topic membership from Django, while leaving the current behavior unchanged by default.

@xtrinch xtrinch force-pushed the feature/topic-subscription-tracking branch from 8ab03ce to ef017f8 Compare April 7, 2026 10:41
@xtrinch xtrinch marked this pull request as ready for review April 7, 2026 13:26
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