$ the-wire · showcase
Ractor-aware schema context, FCM token error mapping
By RepoJournal · Filed · About Rails
Rails reworked SchemaContext for Ractor storage, and Action Push Native now turns FCM invalid-token 400s into TokenError.
Rails split SchemaContext attributes into a separate embedded Attributes object and moved schema context ivars to the model class for lazy evaluation on the main ractor, preparing schema context for per-reactor changes [1]. A follow-up isolates tests using on_ractor to avoid a Ractor bug, so the new Ractor paths are tested safely [2]. Elsewhere, leftover perform_query stubs in TrilogyAdapterTest were removed because Minitest's stub restores the method directly on the instance, so later class-level redefinitions never reached that connection, and injected failures in AsynchronousQueriesTest retry tests never fired [3][4]. Action Push Native now maps FCM 400 INVALID_ARGUMENT with the message 'The registration token is not a valid FCM registration token' to TokenError; it used to raise BadRequestError, so apps never got the TokenError signal they rely on to prune dead devices, and every later push to such a device fails the delivery job again [5][6]. Activity totals across the four repos: 15 commits, 4 PRs.
Action items
- → Update apps using Action Push Native to pick up the TokenError mapping so dead devices get pruned rails/action_push_native [plan]
- → Review the Ractor schema context changes if you run multi-ractor ActiveRecord code rails/rails [monitor]
References
- [1] Ractorize Active Record schema context ↗ rails/rails
- [2] Isolate tests using on_ractor to avoid Ractor bug ↗ rails/rails
- [3] Remove leftover perform_query stubs in TrilogyAdapterTest ↗ rails/rails
- [4] Remove leftover perform_query stubs in TrilogyAdapterTest ↗ rails/rails
- [5] Map FCM invalid-registration-token 400s to TokenError ↗ rails/action_push_native
- [6] Map FCM invalid-registration-token 400s to TokenError ↗ rails/action_push_native