Scales-Nature-Park / start-native-app

MERN based full stack data entry mobile application and admin desktop application for the START project.
MIT License
1 stars 1 forks source link

Sharing Entries #35

Closed mbahgatTech closed 2 years ago

mbahgatTech commented 2 years ago

Changes

Problems

mbahgatTech commented 2 years ago

Updates

Need to add frontend feedback that the entry has been deleted. This can be done by:

  1. Refetching the user data from the server upon deletion (Slow but gets the most updated list of entries)

    OR

  2. Editing the user context data by filtering out the entry from the sharedEntries list on success of the request.

Likely solution is the second one due to its speed. Solution 1 is also less preferable due to the confusion it might present by adding any new shared entries found in the user's document in the database that weren't updated in the frontend (due to extended sessions). That would make the user think that pressing the delete button actually added entries for some reason while in reality it actually deleted the entry but received new entries as a side effect of refetching the user context.

Should also add a periodic refetch of user context data from the database that would then update the entries if any were sent since the last fetch.

mbahgatTech commented 2 years ago

PR Notes