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

Form attachment hash for empty datasets is surprising and/or documented incorrectly #1366

Open
alxndrsn opened this issue Jan 15, 2025 · 0 comments

Comments

@alxndrsn
Copy link
Contributor

  1. docs and code do not match
  2. inconsistent date formats are used

docs vs code

1970-01-01 vs 1970-01-01 00:00:00

docs

* In the [OpenRosa Form Manifest](/central-api-form-management/#openrosa-form-manifest-api), if a Form Attachment is linked to a Dataset then the value of `hash` is the MD5 of the last updated timestamp or the MD5 of `1970-01-01 00:00:00` if the Dataset is empty.

code

return attachment.with({ openRosaHash: md5sum(lastTimestamp ? lastTimestamp.toISOString() : '1970-01-01') });

inconsistent date formats

return attachment.with({ openRosaHash: md5sum(lastTimestamp ? lastTimestamp.toISOString() : '1970-01-01') });

  • format 1970-01-01T00:00:00.000Z if lastTimestamp is truthy
  • format 1970-01-01 if lastTimestamp is falsy
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

No branches or pull requests

1 participant