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

App in invalid state when current survey is deleted on remote #2687

Open
gino-m opened this issue Aug 23, 2024 · 10 comments
Open

App in invalid state when current survey is deleted on remote #2687

gino-m opened this issue Aug 23, 2024 · 10 comments
Labels
type: bug Something isn't working
Milestone

Comments

@gino-m
Copy link
Collaborator

gino-m commented Aug 23, 2024

When we detect the deletion event, we shoud:

  1. Deactive the current survey
  2. Show the user a message
  3. Redirect to the survey list

@rawbzz PTAL?

@gino-m gino-m added the type: bug Something isn't working label Aug 23, 2024
@gino-m gino-m added this to the GA release milestone Aug 23, 2024
@gino-m gino-m added this to Ground Aug 23, 2024
@rawbzz
Copy link

rawbzz commented Aug 23, 2024

so this is when a user is already in the survey collecting data, but the survey got deleted right? in that case, I think they should get a message that pops up, and it redirects them to the survey list

Screenshot 2024-08-23 at 11 01 28 AM

@gino-m
Copy link
Collaborator Author

gino-m commented Aug 23, 2024

LGTM! @amegantz @rawbzz Let's just update the text to make it clear it wasn't the user who accidentally deleted the survey, but rather the survey organizers. Thanks!

@amegantz
Copy link

image
Survey deleted
This survey has been deleted by the survey organizers. Select another survey.
[Go to surveys]

@gino-m
Copy link
Collaborator Author

gino-m commented Aug 28, 2024

@amegantz LGTM!

@anandwana001
Copy link
Collaborator

@amegantz @rawbzz @gino-m If the user has collected the data and then the survey got deleted, then how are we telling user that all these collected data are going to be deleted now?

@gino-m
Copy link
Collaborator Author

gino-m commented Aug 28, 2024

The current model is "send it and forget it" in the sense that users cannot access the data once they've shared it with organizers, so in general they have no visibility into the current remote state of data. The product WG may decide to change this is in the future, but as it stands now they wouldn't get notified.

@shobhitagarwal1612
Copy link
Member

shobhitagarwal1612 commented Oct 20, 2024

After deleting the remote survey, the following sequence of events happen on the app:

  • App receives a broadcast to sync survey from remote
  • App initiates a request to sync survey
  • The request attempts to fetch the survey for the given id from remote datastore.
  • An exception is thrown: com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions.

Maybe we first need to update the firebase function to return appropriate error code (NOT_FOUND).
Another option is to send some metadata with the broadcast message specifying that the survey has been deleted instead of attempting to re-sync.

@gino-m
Copy link
Collaborator Author

gino-m commented Nov 6, 2024

Maybe we first need to update the firebase function to return appropriate error code (NOT_FOUND). Another option is to send some metadata with the broadcast message specifying that the survey has been deleted instead of attempting to re-sync.

Perhaps it's the Firebase rule that need to be updated so that we receive NOT_FOUND when the document doesn't exist. What value does the rule receive for resource when the document is not found?

@shobhitagarwal1612
Copy link
Member

I've been low on bandwidth for the past few weeks. Will try to spend some time on it early next week.

@gino-m
Copy link
Collaborator Author

gino-m commented Nov 20, 2024

@shobhitagarwal1612 Let's postpone for now and demote to P2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

5 participants