Open witash opened 2 months ago
@witash I think this is a duplicate as the error is exactly the same as in this issue: https://github.com/medic/cht-core/issues/8936#issuecomment-2283448932 which, if so, is probably caused by #7375
If so, please connect with @dianabarsan as she's started looking in to this and can probably give you some tips on how to go about fixing it.
I've been meaning to change how the service worker is updated for such a long time. I'm down to put some time into it for next week.
@witash is right, I just reran this test 10 times and it kept failing. I ended up disabling it on those branches.
It appears that one of the muting forms fails to submit - the submit report is stuck on loading:
Ok. I dug further into this:
On CI this fails with:
Looking at browser logs I see:
[error] Console Api Event: [{"type":"object","className":"ye","description":"ye","objectId":"-5119646230267331109.9.1","preview":{"type":"object","description":"ye","overflow":false,"properties":[{"name":"stack","type":"string","value":"TypeError: Failed to fetch\n at https://localhos…at ne.run (https://localhost/polyfills.js:1:6297)"},{"name":"message","type":"string","value":"Failed to fetch"},{"name":"docId","type":"string","value":"_local/RKqlK_XzqTqVNyk1pzNeHg=="},{"name":"result","type":"object","value":"Object"}]}}]
[error] Console Api Event: [{"type":"string","value":"Error replicating to remote server"},{"type":"object","className":"ye","description":"ye","objectId":"-5119646230267331109.9.2","preview":{"type":"object","description":"ye","overflow":false,"properties":[{"name":"stack","type":"string","value":"TypeError: Failed to fetch\n at https://localhos…at ne.run (https://localhost/polyfills.js:1:6297)"},{"name":"message","type":"string","value":"Failed to fetch"},{"name":"docId","type":"string","value":"_local/RKqlK_XzqTqVNyk1pzNeHg=="},{"name":"result","type":"object","value":"Object"}]}}]
[error] Console Api Event: [{"type":"string","value":"Error replicating to remote server"},{"type":"object","className":"ye","description":"ye","objectId":"-5119646230267331109.9.3","preview":{"type":"object","description":"ye","overflow":false,"properties":[{"name":"stack","type":"string","value":"TypeError: Failed to fetch\n at https://localhos…at ne.run (https://localhost/polyfills.js:1:6297)"},{"name":"message","type":"string","value":"Failed to fetch"},{"name":"docId","type":"string","value":"_local/RKqlK_XzqTqVNyk1pzNeHg=="},{"name":"result","type":"object","value":"Object"}]}}]
[error] Console Api Event: [{"type":"object","className":"ye","description":"ye","objectId":"-5119646230267331109.9.4","preview":{"type":"object","description":"ye","overflow":false,"properties":[{"name":"stack","type":"string","value":"TypeError: Failed to fetch\n at https://localhos…H.invoke (https://localhost/polyfills.js:1:10947)"},{"name":"message","type":"string","value":"Failed to fetch"},{"name":"docId","type":"string","value":"_local/RKqlK_XzqTqVNyk1pzNeHg%3D%3D"},{"name":"result","type":"object","value":"Object"}]}}]
[error] Console Api Event: [{"type":"string","value":"Error replicating to remote server"},{"type":"object","className":"ye","description":"ye","objectId":"-5119646230267331109.9.5","preview":{"type":"object","description":"ye","overflow":false,"properties":[{"name":"stack","type":"string","value":"TypeError: Failed to fetch\n at https://localhos…H.invoke (https://localhost/polyfills.js:1:10947)"},{"name":"message","type":"string","value":"Failed to fetch"},{"name":"docId","type":"string","value":"_local/RKqlK_XzqTqVNyk1pzNeHg%3D%3D"},{"name":"result","type":"object","value":"Object"}]}}]
[error] Console Api Event: [{"type":"string","value":"Error replicating to remote server"},{"type":"object","className":"ye","description":"ye","objectId":"-5119646230267331109.9.6","preview":{"type":"object","description":"ye","overflow":false,"properties":[{"name":"stack","type":"string","value":"TypeError: Failed to fetch\n at https://localhos…H.invoke (https://localhost/polyfills.js:1:10947)"},{"name":"message","type":"string","value":"Failed to fetch"},{"name":"docId","type":"string","value":"_local/RKqlK_XzqTqVNyk1pzNeHg%3D%3D"},{"name":"result","type":"object","value":"Object"}]}}]
And when I check api logs, do find a request for this _local doc that got interrupted (?):
2024-09-04T13:23:53.251 REQ: c7b252f8-da30-49f7-9acd-d4d13a782f01 172.18.0.1 - PUT /medic/_local/RKqlK_XzqTqVNyk1pzNeHg%3D%3D HTTP/1.0
2024-09-04T13:23:53.271 DEBUG: Checking for a configured outgoing message service
2024-09-04T13:23:53.312 RES: c7b252f8-da30-49f7-9acd-d4d13a782f01 172.18.0.1 - PUT /medic/_local/RKqlK_XzqTqVNyk1pzNeHg%3D%3D HTTP/1.0 - - - ms
I'm not sure about the reason for this interruption. I'm not seeing this request in Haproxy.
This means that this is unrelated to https://github.com/medic/cht-core/issues/7375
[error] Console Api Event: [{"type":"string","value":"Error replicating to remote server"}
I'm wondering if it's related to throttling the browser to offline then online again. Maybe going online is failing silently, or the await is resolving too quickly? If we're confident it's a testing only issue, then we could experiment with adding a pause after going back online, or even better waiting for a remote request to succeed before being confident that we're online again.
I've moved this to 4.12.
related to throttling the browser to offline then online again
This could be. I've just implemented a retry and the error proved non persistent.
Locally. I had geolocation timing out, which caused the endless loading I detailed above. This seems to not affect the test when run in CI.
Moved to 4.15.0 so as not to hold up the release.
@dianabarsan are you working on fixing this test? I was planning on investigating to see if I could fix it, but first, I wanted to ensure I would not interfere.
I tried ... got frustrated and set off to greener pastures. Have a knack at it!
Moving it 4.16
Describe the issue
for an offline user should mute and unmute a clinic while "offline", without processing in between
andfor an offline user should mute and unmute a person while "offline", with processing in between
in/tests/e2e/default/transitions/client-side-muting.wdio-spec.js
fail for about 2/3 workflow runshttps://github.com/medic/cht-core/actions/runs/10610097929/job/29407417054
Because it does pass 1/3 of the time, the assumption is that the test is broken, rather than the feature, but need to confirm.
Describe the improvement you'd like Fix the test. First thing to try is increasing the timeout, although would be better to fix the underlying issue; 20s should be plenty.