When a request is pending we would like to clean the error message so that when a new request fails a user is able to see that this is another request.
Details
Modify update_thread endpoint to fail every second time and check if the UI behaves correctly
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Nice, thanks for addressing my inline feedback in D4364. This change looks good and addresses the potential bug.
Just out of curiosity, in your Test Plan you state that you modified the update_thread endpoint to fail every second time. If it's not too much effort, could you explain how you did this? It could help me on some potential testing I'm working on. If not, I can message you offline.
Just out of curiosity, in your Test Plan you state that you modified the update_thread endpoint to fail every second time. If it's not too much effort, could you explain how you did this? It could help me on some potential testing I'm working on. If not, I can message you offline.
Sure! I simply modified threadUpdateResponder located in thread-responders.js file
let i = 0; async function threadUpdateResponder( viewer: Viewer, input: any, ): Promise<ChangeThreadSettingsResult> { if (i++ % 2 === 0) { throw 'a'; } const request: UpdateThreadRequest = input; await validateInput(viewer, updateThreadRequestInputValidator, request); return await updateThread(viewer, request); }
Other testing ideas I used in the past were to e.g. include a delay, include a delay conditionally (e.g. in every second request), throw based on input - it was especially useful when testing sending new messages (every message included a number that indicated how many times a message should retried before being successful). Those are just the ideas - but maybe some of them will inspire you.
Ah, thanks! Just using a variable and throwing an exception every second time. Sometimes the simplest solution is the best.