Skip to content

fix: set SyncedBy from record's CreatedBy instead of sync operator#171

Open
snehar-nd wants to merge 1 commit into
release-3.6.2from
fix/data-sync-syncedby-mismatch
Open

fix: set SyncedBy from record's CreatedBy instead of sync operator#171
snehar-nd wants to merge 1 commit into
release-3.6.2from
fix/data-sync-syncedby-mismatch

Conversation

@snehar-nd

Copy link
Copy Markdown
Contributor

📋 Description

JIRA ID:

AMM-2323

✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

ℹ️ Additional Information

  • SyncedBy was being set to whoever triggered the data sync session,
    not the nurse who created the record
  • Caused mismatches when different users performed different operations
    (e.g., NurseVizagmmu2 created records, NurseMysuru triggered sync)
  • Fixed by using each record's own CreatedBy as SyncedBy, with fallback
    to the sync operator if CreatedBy is null

SyncedBy was being overwritten with whoever triggered the data sync
session, causing mismatches when a different nurse initiated the sync
than the one who created the records. Now SyncedBy = CreatedBy of each
individual record, falling back to the sync operator only if CreatedBy
is null.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 00b09b43-d811-4803-a7be-72ec959a0eb1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@vanitha1822 vanitha1822 left a comment

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.

The created user and synced user might be different. @snehar-nd

@snehar-nd

snehar-nd commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

The created user and synced user might be different. @snehar-nd

The issue itself, Created and Synced should be the same. @vanitha1822

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.

2 participants