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

Offline Sync records CreatedAt is null until PushAsync is called and if set directly, is overwritten with the Sync time. #74

renzska opened this issue Feb 3, 2016 · 3 comments


Copy link

@renzska renzska commented Feb 3, 2016

In our code, we display records with the date they were created. We are using the CreatedAt field to do this. When switching over to use offline sync, a new local record does not have the CreatedAt field populated until after a PushAsync is called. To address this issue we are setting the CreatedAt value to DateTime.Now; so we have a value in the local DB before the push. In our testing, however, the CreatedAt date is overwritten with the time the sync occurs.

Is it fair to say that the CreatedAt should not be used in this manner? If we want to store the date the user created the record, we would need to store it in our own field? I'm guessing this is the case. It would be good to have this documented somewhere.

Copy link

@apoorvg apoorvg commented Feb 12, 2016

We have observed the same behavior and are using our own field to store the record creation time. CreatedAt / UpdatedAt are always updated / overridden post Push.

Copy link

@nadjibus nadjibus commented Mar 16, 2016

+1, could be helpful if we can save CreatedAt to local table, then let the server overrides it when we Sync (to avoid malicious things/invalid device Date/Time)

Copy link

@lindydonna lindydonna commented May 4, 2016

@renzska CreatedAt cannot be used in this way. If you need the value of the local created at, you will need to create a new field. You can create it only locally, if you use the JsonIgnore attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.