Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syncStageStartedAt not correctly set #7436

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

bosiraphael
Copy link
Contributor

Fix syncStageStartedAt not correctly set

Copy link
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.

PR Summary

This pull request addresses an issue with the 'syncStageStartedAt' field not being correctly set during the message import process in the Twenty server.

  • Added setting of 'syncStageStartedAt' in packages/twenty-server/src/modules/messaging/common/services/message-channel-sync-status.service.ts when marking channels as 'MESSAGES_IMPORT_ONGOING'
  • Removed MessageChannelSyncStage check and import in packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-messages-import.service.ts
  • Removed 'syncStageStartedAt: null' from update operation in packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-partial-message-list-fetch.service.ts
  • These changes aim to improve sync stage tracking and process management

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@@ -55,13 +52,6 @@ export class MessagingMessagesImportService {
let messageIdsToFetch: string[] = [];

try {
if (
Copy link
Member

Choose a reason for hiding this comment

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

@bosiraphael why are we removing this condition? it seems legit to me

@@ -54,7 +54,6 @@ export class MessagingPartialMessageListFetchService {
},
{
throttleFailureCount: 0,
syncStageStartedAt: null,
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this one, are you afraid of race conditions?

Copy link
Member

Choose a reason for hiding this comment

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

actually I agree with this one as this is the role of the message-channel-sync status

@@ -161,6 +161,7 @@ export class MessageChannelSyncStatusService {

await messageChannelRepository.update(messageChannelIds, {
syncStage: MessageChannelSyncStage.MESSAGES_IMPORT_ONGOING,
syncStageStartedAt: new Date().toISOString(),
Copy link
Member

Choose a reason for hiding this comment

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

I think that's it, I'm not sure about the other changes

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

Thanks @bosiraphael! I've left a few comments

@charlesBochet charlesBochet merged commit 23e7958 into main Oct 4, 2024
3 of 4 checks passed
@charlesBochet charlesBochet deleted the fix-sync-stage-started-at branch October 4, 2024 22:44
harshit078 pushed a commit to harshit078/twenty that referenced this pull request Oct 14, 2024
Fix syncStageStartedAt not correctly set

---------

Co-authored-by: Charles Bochet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants