Skip to content

Made the code more resilient to stale value prop in date filter#17038

Merged
lucasbordeau merged 2 commits intomainfrom
fix/date-filter-with-stale-value
Jan 9, 2026
Merged

Made the code more resilient to stale value prop in date filter#17038
lucasbordeau merged 2 commits intomainfrom
fix/date-filter-with-stale-value

Conversation

@lucasbordeau
Copy link
Copy Markdown
Contributor

Fixes : #17035

There was a bad pattern which risked introduce this bug in turnRecordFilterIntoRecordGqlOperationFilter after recent refactor of date logic and date filters, which didn't create any bug during dev time because it wasn't tested with value combinations that existed before the refactor.

Code has been re-organized to make it resilient to any wrong value combination.

Also fixed a small bug that appeared during QA with DATE filter type, which was blocking the save button from disappearing after a save.

@lucasbordeau lucasbordeau changed the title Made the code more resilient to stale value prop in filter Made the code more resilient to stale value prop in date filter Jan 9, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 9, 2026

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:7132

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Copy Markdown
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment about a potential refactoring but non blocking
LGMT! @lucasbordeau

);
}
case 'DATE': {
if (recordFilter.operand === RecordFilterOperand.IS_RELATIVE) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there is a few duplicated logic between date and datetime in this file, what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it in a follow-up PR.

Copy link
Copy Markdown
Contributor Author

@lucasbordeau lucasbordeau Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Weiko I did look at what could be refactored and there seems to be enough subtle differences between how plain date and date times are handled for each operator to justify this structure that looks like it could be refactored. I think it's not worth it. Charles mentioned earlier that we could split this big function into smaller functions for each field type though, which would be interesting to do.

@lucasbordeau lucasbordeau added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit 2fb099e Jan 9, 2026
77 checks passed
@lucasbordeau lucasbordeau deleted the fix/date-filter-with-stale-value branch January 9, 2026 14:20
@twenty-eng-sync
Copy link
Copy Markdown

Hey @lucasbordeau! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

1 similar comment
@twenty-eng-sync
Copy link
Copy Markdown

Hey @lucasbordeau! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

prastoin pushed a commit that referenced this pull request Jan 12, 2026
Fixes : #17035

There was a bad pattern which risked introduce this bug in
`turnRecordFilterIntoRecordGqlOperationFilter` after recent refactor of
date logic and date filters, which didn't create any bug during dev time
because it wasn't tested with value combinations that existed before the
refactor.

Code has been re-organized to make it resilient to any wrong value
combination.

Also fixed a small bug that appeared during QA with `DATE` filter type,
which was blocking the save button from disappearing after a save.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date Filter is Empty - A customer cannot access his Overdue tasks

2 participants