Skip to content

Commit 401b3a2

Browse files
committed
caught-up: Drop legacy inference for servers pre-1.8
Huzzah! Look at that negative diffstat. Also make a note next to where we record `minSupportedVersion`, in ServerCompatBanner.js. We may at some point want to have the app outright refuse to operate on sufficiently ancient servers, where it's just not going to be a good experience. Until then, it seems helpful to track what we know about what the consequences are likely to be (though actually *testing* on such ancient servers would be significantly more effort and not worth it.)
1 parent 026a4f9 commit 401b3a2

File tree

7 files changed

+31
-397
lines changed

7 files changed

+31
-397
lines changed

src/__tests__/lib/exampleData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,8 @@ export const action = Object.freeze({
713713
anchor: 0,
714714
numBefore: 50,
715715
numAfter: 50,
716-
foundNewest: undefined,
717-
foundOldest: undefined,
716+
foundNewest: false,
717+
foundOldest: false,
718718
ownUserId: selfUser.user_id,
719719
}): MessageFetchCompleteAction),
720720
// If a given action is only relevant to a single test file, no need to

src/actionTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ export type MessageFetchCompleteAction = {|
221221
anchor: number,
222222
numBefore: number,
223223
numAfter: number,
224-
foundNewest: boolean | void,
225-
foundOldest: boolean | void,
224+
foundNewest: boolean,
225+
foundOldest: boolean,
226226
ownUserId: UserId,
227227
|};
228228

src/api/messages/getMessages.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { AvatarURL } from '../../utils/avatar';
1010
type ApiResponseMessages = {|
1111
...$Exact<ApiResponseSuccess>,
1212
anchor: number,
13-
found_anchor?: boolean,
14-
found_newest?: boolean,
15-
found_oldest?: boolean,
13+
found_anchor: boolean,
14+
found_newest: boolean,
15+
found_oldest: boolean,
1616
messages: Message[],
1717
|};
1818

@@ -84,13 +84,7 @@ const migrateResponse = (response, identity: Identity) => {
8484

8585
/**
8686
* See https://zulip.com/api/get-messages
87-
*
88-
* These values exist only in Zulip 1.8 or newer:
89-
* * found_anchor
90-
* * found_newest
91-
* * found_oldest
9287
*/
93-
// TODO(server-1.8): Mark those properties as required; simplify downstream.
9488
export default async (
9589
auth: Auth,
9690
args: {|

0 commit comments

Comments
 (0)