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

Server needs to accept at least one post to allow offline capabilities #10

Open
maberer opened this issue Jul 21, 2016 · 0 comments
Open

Comments

@maberer
Copy link

maberer commented Jul 21, 2016

Thanks for the great demo!

Nevertheless, I think there is an issue related to the offline capabilities of the app when
the server is not running while a first message is posted.

In this case, the new post is stored but the user is not.

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/job/post/SaveNewPostJob.java#L98

When the "NewPostEvent " event is fired and the post should be added to the list, the user is not found because it has not been saved to the datastore. As a consequence, "user" is null in the following line:

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/model/FeedModel.java#L74

Because "users" is empty, the result array is empty.

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/model/FeedModel.java#L73

So the post is never added to the list.

To get the expected behavior, the server has to run/respond at least the first time
a post is made. If this is the case, the returned user is added to the local datastore.

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/job/post/SaveNewPostJob.java#L116

In the case outlined above, this line never runs and posts never appear.

I do not think that this is intended behavior.

What do you think?

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