Order the steps
Order what happens when a user edits a note offline.
- Apply the server's result and clear the pending flag
- When online, send the change with its ID and version
- Write the edit to Room marked as pending
- Enqueue unique sync work with a network constraint
Choose an answer, then open Show answer below to check it.
Show answer
Answer: C D B A
- Write the edit to Room marked as pending The UI updates at once.
- Enqueue unique sync work with a network constraint WorkManager waits for connectivity.
- When online, send the change with its ID and version The server can spot conflicts.
- Apply the server's result and clear the pending flag Local and server agree.