JustinWei2010 / EventETAApp

0 stars 0 forks source link

Refreshing event details on subsequent load #1

Open dontian80 opened 7 years ago

dontian80 commented 7 years ago

Refresh the attendee count on subsequent event details page load

JustinWei2010 commented 7 years ago

Not a simple fix. The reason why this is passed is because some of the data is passed from home page to details page screen. This makes sense because some of the data is the same, and if its not passed the render does not happen immediately (slow load, and might not look good if height animates on load. Will also cause even more complications with show more). Need to decide exactly what we want to pass from homepage to event details page, and what the customer should see initially and what they should see load in real time.

doannhat commented 7 years ago

One solution I've been trying, though might not be optimal, is to only pass eventId from HomeScreen to DetailScreen/ Then we call fetchFbEvents in DetailScreen to get the most up-to-date events, then we find the event we want based on the passed in eventId. I don't think we can get the up-to-date details without re-calling the API, unless fb has some kind of eventing (emit a message/notification when there's a change, so client get notified and recall the API)

The cons here obviously is latency when we fetchFbEvents. I got it semi-working, minus the handling latency part. This latency plus the latency to get Attendees and ETAs, would it be worth it to create a loading screen? Or a better Spinner?

JustinWei2010 commented 7 years ago

Thats exactly what it was before, and I changed it to avoid the load issue. It doesn't look good when you load it like that, you want to avoid loading screens as much as you can. We should probably only have one at the app startup. A hybrid approach is better, where you pass things that you don't need to reupdate(title, event id, etc). Ideally it should be fields that are included in home screen events since it would be inconsistent (not sure what to do for date).

The inconsistency issue can actually be solved by updating the event in the eventlist any time we fetch event data from facebook.

doannhat commented 7 years ago

Let's solve this by recalling fbAPI when user swipe down to refresh given that Event Detail and attendees don't change that often. When user swipes down inside Event Page, we keeps existing view until data is fetched, then rerender is triggered. I believe updating events "state" will also trigger rerendering in Home Page, so shit will be consistent.

We can also add the same refresh mechanism on home page which will have same effect

@JustinWei2010 let me know if you think I miss sth.