Skip to content

model: Issues with LOGIN_SUCCESS, REGISTER_COMPLETE, DEAD_QUEUE #5605

@chrisbobbe

Description

@chrisbobbe

In the office last week, @gnprice and I found some bundles of problems with how our reducers handle LOGIN_SUCCESS, REGISTER_COMPLETE, and DEAD_QUEUE. Here's a summary I put together just now, made a bit more specific with help from git grep:

  • Consistently clear old data on all ways of leaving an account #4446: A bunch of server data, and some per-account client-side data (outbox and drafts) isn't being cleared on LOGIN_SUCCESS, but it should be
  • (done in model: Make REGISTER_COMPLETE reset some state we forgot about #5613) REGISTER_COMPLETE should reset or replace all server data and server-data metadata, but it isn't in some cases:
    • server data: topics, typing (should reset)
    • server-data metadata: fetching (should reset)
  • (Open PR: model [nfc]: Comment on rest of REGISTER_COMPLETE handlers that reset state #5630) Some reducers don't have a comment saying why they reset state on REGISTER_COMPLETE instead of taking data from its payload:
    • For example, flagsReducer should point out that messagesReducer doesn't store messages on REGISTER_COMPLETE, and messagesReducer should say that it doesn't do that because we fetch messages with GET /messages.
    • (Probably plenty of other instances.)
  • DEAD_QUEUE should clear out server-data metadata, but it isn't in some cases:
    • caughtUp
    • fetching
  • (Open PR: typing model: Don't reset on DEAD_QUEUE #5631) DEAD_QUEUE is clearing out typing but probably doesn't need to; we don't clear other server data on DEAD_QUEUE, plus there's already a client-side component that makes this feature fail gracefully in the presence of stale server data (a timeout to clear typing indicators)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions