File tree Expand file tree Collapse file tree 6 files changed +32
-8
lines changed Expand file tree Collapse file tree 6 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,14 @@ export default (
32
32
action : PerAccountApplicableAction ,
33
33
) : CaughtUpState => {
34
34
switch ( action . type ) {
35
- case REGISTER_COMPLETE :
36
35
case RESET_ACCOUNT_DATA :
37
36
return initialState ;
38
37
38
+ // Reset because `caughtUp` is server-data metadata, and we're resetting
39
+ // the server data it's supposed to apply to: `state.narrows`.
40
+ case REGISTER_COMPLETE :
41
+ return initialState ;
42
+
39
43
case MESSAGE_FETCH_START : {
40
44
// We don't want to accumulate old searches that we'll never
41
45
// need again.
Original file line number Diff line number Diff line change @@ -71,10 +71,11 @@ export default (
71
71
return initialState ;
72
72
73
73
// Reset just because `fetching` is server-data metadata, and we're
74
- // resetting the server data it's supposed to apply to… But really, we
75
- // should have canceled any in-progress message fetches by now; that's
76
- // #5623. Still, even if there is an in-progress fetch, we probably
77
- // don't want to show loading indicators for it in the UI.
74
+ // resetting the server data it's supposed to apply to
75
+ // (`state.narrows`)… But really, we should have canceled any
76
+ // in-progress message fetches by now; that's #5623. Still, even if
77
+ // there is an in-progress fetch, we probably don't want to show loading
78
+ // indicators for it in the UI.
78
79
// TODO(#5623): Remove reference to #5623.
79
80
case REGISTER_COMPLETE :
80
81
return initialState ;
Original file line number Diff line number Diff line change @@ -131,10 +131,16 @@ export default (
131
131
action : PerAccountApplicableAction ,
132
132
) : FlagsState => {
133
133
switch ( action . type ) {
134
- case REGISTER_COMPLETE :
135
134
case RESET_ACCOUNT_DATA :
136
135
return initialState ;
137
136
137
+ // Reset to clear stale data. We don't initialize the
138
+ // messages/narrows/flags model using initial data; instead, we fetch
139
+ // chunks of data as needed with api.getMessages. See
140
+ // https://zulip.readthedocs.io/en/latest/subsystems/events-system.html#messages
141
+ case REGISTER_COMPLETE :
142
+ return initialState ;
143
+
138
144
case MESSAGE_FETCH_COMPLETE :
139
145
return processFlagsForMessages ( state , action . messages ) ;
140
146
Original file line number Diff line number Diff line change @@ -194,10 +194,16 @@ export default (
194
194
action : PerAccountApplicableAction ,
195
195
) : NarrowsState => {
196
196
switch ( action . type ) {
197
- case REGISTER_COMPLETE :
198
197
case RESET_ACCOUNT_DATA :
199
198
return initialState ;
200
199
200
+ // Reset to clear stale data. We don't initialize the
201
+ // messages/narrows/flags model using initial data; instead, we fetch
202
+ // chunks of data as needed with api.getMessages. See
203
+ // https://zulip.readthedocs.io/en/latest/subsystems/events-system.html#messages
204
+ case REGISTER_COMPLETE :
205
+ return initialState ;
206
+
201
207
case MESSAGE_FETCH_START : {
202
208
// We don't want to accumulate old searches that we'll never need again.
203
209
if ( isSearchNarrow ( action . narrow ) ) {
Original file line number Diff line number Diff line change @@ -139,10 +139,16 @@ export default (
139
139
globalState : PerAccountState ,
140
140
) : MessagesState => {
141
141
switch ( action . type ) {
142
- case REGISTER_COMPLETE :
143
142
case RESET_ACCOUNT_DATA :
144
143
return initialState ;
145
144
145
+ // Reset to clear stale data. We don't initialize the
146
+ // messages/narrows/flags model using initial data; instead, we fetch
147
+ // chunks of data as needed with api.getMessages. See
148
+ // https://zulip.readthedocs.io/en/latest/subsystems/events-system.html#messages
149
+ case REGISTER_COMPLETE :
150
+ return initialState ;
151
+
146
152
case MESSAGE_FETCH_COMPLETE :
147
153
return state . merge (
148
154
Immutable . Map (
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export default (
26
26
action : PerAccountApplicableAction ,
27
27
) : OutboxState => {
28
28
switch ( action . type ) {
29
+ // TODO(#3881): Figure out if we want this.
29
30
case REGISTER_COMPLETE :
30
31
return filterArray ( state , ( outbox : Outbox ) => ! outbox . isSent ) ;
31
32
You can’t perform that action at this time.
0 commit comments