Skip to content

Commit 6f60b11

Browse files
remove patch for bug (#9245) (#9248)
1 parent 3431f29 commit 6f60b11

File tree

2 files changed

+1
-79
lines changed

2 files changed

+1
-79
lines changed

app/products/playbooks/database/operators/comparators/index.test.ts

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -75,71 +75,4 @@ describe('shouldHandlePlaybookChecklistItemRecord', () => {
7575

7676
expect(shouldHandlePlaybookChecklistItemRecord(existingRecord, raw)).toBe(true);
7777
});
78-
79-
it('should return true when condition_action changes even if update_at is the same', () => {
80-
const existingRecord = TestHelper.fakePlaybookChecklistItemModel({
81-
updateAt: 112233,
82-
conditionAction: '',
83-
});
84-
const raw = TestHelper.fakePlaybookChecklistItem(existingRecord.checklistId, {
85-
update_at: 112233,
86-
condition_action: 'hidden',
87-
});
88-
89-
expect(shouldHandlePlaybookChecklistItemRecord(existingRecord, raw)).toBe(true);
90-
});
91-
92-
it('should return true when condition_reason changes even if update_at is the same', () => {
93-
const existingRecord = TestHelper.fakePlaybookChecklistItemModel({
94-
updateAt: 112233,
95-
conditionReason: '',
96-
});
97-
const raw = TestHelper.fakePlaybookChecklistItem(existingRecord.checklistId, {
98-
update_at: 112233,
99-
condition_reason: 'Dependent task not completed',
100-
});
101-
102-
expect(shouldHandlePlaybookChecklistItemRecord(existingRecord, raw)).toBe(true);
103-
});
104-
105-
it('should return false when condition fields are unchanged and update_at is the same', () => {
106-
const existingRecord = TestHelper.fakePlaybookChecklistItemModel({
107-
updateAt: 112233,
108-
conditionAction: 'hidden',
109-
conditionReason: 'Some reason',
110-
});
111-
const raw = TestHelper.fakePlaybookChecklistItem(existingRecord.checklistId, {
112-
update_at: 112233,
113-
condition_action: 'hidden',
114-
condition_reason: 'Some reason',
115-
});
116-
117-
expect(shouldHandlePlaybookChecklistItemRecord(existingRecord, raw)).toBe(false);
118-
});
119-
120-
it('should return true when condition_action changes from hidden to shown_because_modified', () => {
121-
const existingRecord = TestHelper.fakePlaybookChecklistItemModel({
122-
updateAt: 112233,
123-
conditionAction: 'hidden',
124-
});
125-
const raw = TestHelper.fakePlaybookChecklistItem(existingRecord.checklistId, {
126-
update_at: 112233,
127-
condition_action: 'shown_because_modified',
128-
});
129-
130-
expect(shouldHandlePlaybookChecklistItemRecord(existingRecord, raw)).toBe(true);
131-
});
132-
133-
it('should return false when condition_action is undefined in raw data', () => {
134-
const existingRecord = TestHelper.fakePlaybookChecklistItemModel({
135-
updateAt: 112233,
136-
conditionAction: 'hidden',
137-
});
138-
const raw = TestHelper.fakePlaybookChecklistItem(existingRecord.checklistId, {
139-
update_at: 112233,
140-
});
141-
delete raw.condition_action;
142-
143-
expect(shouldHandlePlaybookChecklistItemRecord(existingRecord, raw)).toBe(false);
144-
});
14578
});

app/products/playbooks/database/operators/comparators/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,5 @@ export const shouldHandlePlaybookChecklistRecord = (existingRecord: PlaybookChec
1414
};
1515

1616
export const shouldHandlePlaybookChecklistItemRecord = (existingRecord: PlaybookChecklistItemModel, raw: PartialChecklistItem): boolean => {
17-
// Check if update_at has changed (primary check)
18-
if (existingRecord.updateAt !== raw.update_at) {
19-
return true;
20-
}
21-
22-
// Check if condition fields have changed (allows updates without update_at change)
23-
const conditionActionChanged = raw.condition_action !== undefined &&
24-
existingRecord.conditionAction !== raw.condition_action;
25-
const conditionReasonChanged = raw.condition_reason !== undefined &&
26-
existingRecord.conditionReason !== raw.condition_reason;
27-
28-
return Boolean(conditionActionChanged || conditionReasonChanged);
17+
return Boolean(existingRecord.updateAt !== raw.update_at);
2918
};

0 commit comments

Comments
 (0)