Skip to content

Commit

Permalink
mute: Remove ancient-server support from the reasons for a fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Mar 31, 2023
1 parent 100c6a0 commit b303fda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 0 additions & 10 deletions src/mute/__tests__/muteModel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ describe('reducer', () => {
expect(newState).toBeTruthy();
expect(newState && getMute(newState)).toEqual(makeMuteState([[eg.stream, 'topic']]));
});

// TODO(#5102): Delete; see comment on implementation.
test('in ancient no-muted-topics format', () => {
const state = makeMuteState([[eg.stream, 'topic']]);
const action = eg.mkActionRegisterComplete({
muted_topics: undefined,
user_topics: undefined,
});
expect(reducer(state, action, eg.plusReduxState)).toEqual(initialState);
});
});

describe('RESET_ACCOUNT_DATA', () => {
Expand Down
10 changes: 4 additions & 6 deletions src/mute/muteModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ export const reducer = (
// TODO(server-6.0): Stop caring about that, when we cut muted_topics.
return convertLegacy(
action.data.muted_topics
// TODO(#5102): Delete fallback once we enforce any threshold for
// ancient servers we refuse to connect to. It was added in
// #2878 (2018-11-16), but it wasn't clear even then, it seems,
// whether any servers actually omit the data. The API doc
// doesn't mention any servers that omit it, and our Flow types
// mark it required.
// Unnecessary fallback just to satisfy Flow: the old
// `muted_topics` is absent only when the new `user_topics` is
// present (ignoring ancient unsupported servers), but Flow
// doesn't track that.
?? [],
getStreamsByName(globalState),
);
Expand Down

0 comments on commit b303fda

Please sign in to comment.