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

Returning null from outgoing sync utilities #2997

Closed
sussol-bot opened this issue Jun 30, 2020 · 4 comments · Fixed by #3000
Closed

Returning null from outgoing sync utilities #2997

sussol-bot opened this issue Jun 30, 2020 · 4 comments · Fixed by #3000
Assignees
Labels
Bug: production Bug was found or believed to be in a live release bugsnag Docs: not needed Effort: small Small effort story/task, estimated 0-2 days Priority: high
Milestone

Comments

@sussol-bot
Copy link
Collaborator

sussol-bot commented Jun 30, 2020

Describe the problem

As mentioned here: #2997 (comment) returning null from outgoingSyncUtils halts sync

Describe the solution

Somehow filter the record from entering the sync queue, rather than returning null from outgoingSyncUtils

Error in mSupply Mobile

Error in SYNC ERROR
No data found in JSON record

View on Bugsnag

Stacktrace

index.android.bundle:1718 - 

View full stacktrace

Created automatically via Bugsnag

@josh-griffin
Copy link
Contributor

hmm any thoughts on this one @wlthomson ? Seems like this is some testing or something, going by the sync URL

image

@wlthomson
Copy link
Contributor

wlthomson commented Jul 1, 2020

Hmm, I think there may be a couple of bugs in outgoing sync 😨.

It looks like generateSyncData has some cases where it returns null (looks like we both contributed some!), e.g.

case 'Transaction': {
  // Only sync prescriptions which are finalised.
  if (record.isPrescription && !record.isFinalised) return null;

I may be missing something, but AFAICS there's no logic for actually catching these sync out records with null data and preventing them from syncing... Thoughts?

@josh-griffin
Copy link
Contributor

ah nice catch! looks like it!

@josh-griffin josh-griffin changed the title Error in SYNC ERROR Returning null from outgoingSyncUtils Jul 1, 2020
@josh-griffin josh-griffin added Bug: production Bug was found or believed to be in a live release Docs: not needed Effort: small Small effort story/task, estimated 0-2 days Priority: high labels Jul 1, 2020
@wlthomson wlthomson self-assigned this Jul 1, 2020
@wlthomson wlthomson added this to the 5.1.X milestone Jul 1, 2020
@wlthomson wlthomson changed the title Returning null from outgoingSyncUtils Returning null from outgoing sync utilities Jul 3, 2020
@wlthomson wlthomson mentioned this issue Jul 3, 2020
16 tasks
wlthomson added a commit that referenced this issue Jul 5, 2020
@wlthomson
Copy link
Contributor

Fixed by #3000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: production Bug was found or believed to be in a live release bugsnag Docs: not needed Effort: small Small effort story/task, estimated 0-2 days Priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants