Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3299347
D3354.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D3354.diff
View Options
diff --git a/server/src/fetchers/message-fetchers.js b/server/src/fetchers/message-fetchers.js
--- a/server/src/fetchers/message-fetchers.js
+++ b/server/src/fetchers/message-fetchers.js
@@ -8,6 +8,7 @@
} from 'lib/shared/message-utils';
import { messageSpecs } from 'lib/shared/messages/message-specs';
import { notifCollapseKeyForRawMessageInfo } from 'lib/shared/notif-utils';
+import { hasMinCodeVersion } from 'lib/shared/version-utils';
import {
type RawMessageInfo,
type RawComposableMessageInfo,
@@ -254,7 +255,7 @@
criteria: MessageSelectionCriteria,
numberPerThread: number,
): Promise<FetchMessageInfosResult> {
- const selectionClause = messageSelectionCriteriaToSQLClause(criteria);
+ const selectionClause = messageSelectionCriteriaToSQLClause(viewer, criteria);
const truncationStatuses = {};
const viewerID = viewer.id;
@@ -352,19 +353,25 @@
}
function messageSelectionCriteriaToSQLClause(
+ viewer: Viewer,
criteria: MessageSelectionCriteria,
) {
const minMessageTime = Date.now() - defaultMaxMessageAge;
+ const shouldApplyTimeFilter = hasMinCodeVersion(viewer.platformDetails, 130);
let globalTimeFilter;
if (criteria.newerThan) {
globalTimeFilter = SQL`m.time > ${criteria.newerThan}`;
- } else if (!criteria.threadCursors) {
+ } else if (!criteria.threadCursors && shouldApplyTimeFilter) {
globalTimeFilter = SQL`m.time > ${minMessageTime}`;
}
const threadConditions = [];
- if (criteria.joinedThreads === true && !globalTimeFilter) {
+ if (
+ criteria.joinedThreads === true &&
+ shouldApplyTimeFilter &&
+ !globalTimeFilter
+ ) {
threadConditions.push(SQL`(mm.role > 0 AND m.time > ${minMessageTime})`);
} else if (criteria.joinedThreads === true) {
threadConditions.push(SQL`mm.role > 0`);
@@ -408,7 +415,7 @@
criteria: MessageSelectionCriteria,
maxNumberPerThread: number,
): Promise<FetchMessageInfosResult> {
- const selectionClause = messageSelectionCriteriaToSQLClause(criteria);
+ const selectionClause = messageSelectionCriteriaToSQLClause(viewer, criteria);
const truncationStatuses = messageSelectionCriteriaToInitialTruncationStatuses(
criteria,
messageTruncationStatus.UNCHANGED,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 10:58 AM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534833
Default Alt Text
D3354.diff (2 KB)
Attached To
Mode
D3354: [server] Gate global time filter for message queries on codeVersion
Attached
Detach File
Event Timeline
Log In to Comment