roundware / roundware-web-template

roundware-web-template.vercel.app
1 stars 4 forks source link

Can't upload sounds when allow_speak_tags set to false #7

Closed gavspav closed 1 year ago

gavspav commented 2 years ago

I have set allow_speak_tags to false and set the default tags to the ids corresponding with 'male' and 'visitor' When I try to submit a recording the web app hangs with the following error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'tag_id') at index.tsx:266:54 at Array.map () at index.tsx:266:41 at f (regeneratorRuntime.js:86:17) at Generator._invoke (regeneratorRuntime.js:66:24) at Generator.next (regeneratorRuntime.js:117:21) at r (asyncToGenerator.js:3:20) at s (asyncToGenerator.js:25:9) at asyncToGenerator.js:32:7 at new Promise ()

My workaround (to skip the questions) is in this file I comment out lines 263-269 and replace them with : const finalTags = config.DEFAULT_SPEAK_TAGS;

Sorry for the ugly hack. I really should've been able to come up with a decent solution :-/

hburgund commented 2 years ago

@gavspav can you confirm if this fixes the issue for you?

https://github.com/shreyas-jadhav/roundware-web-template/commit/7fd9c1f62e19b1d7cbea2a818230d82c3d4f3427

gavspav commented 2 years ago

No it doesn't. It fixes the issue of an infinite loop between the tag questions and the map in the browser window.

But it still doesn't allow me to submit audio.

I left the most important bit of the error message out (above) - I've edited it now. Looks like undefined tag_id. I tried to chase this but couldn't work out where selected_tags was defined.

hburgund commented 2 years ago

OK, glad you are seeing the infinite loop fix as I thought that was OK now. But regarding the submission issue, I'll investigate. I think it may not be an undefined tag_id but rather an undefined object that is supposed to contain a tag_id property. Either way, we'll figure it out...thx.

shreyas-jadhav commented 2 years ago

I think when empty list of tags is passed as form data it causes issues on server to decode, this should fix: https://github.com/roundware/roundware-web-template/pull/11/commits/05425c42314b79aef3622ea279c37ed2f42dec9b (not including tags if length is 0)

gavspav commented 2 years ago

Nope - still not working for me with this change, sorry

shreyas-jadhav commented 1 year ago

OK, sorry about it! If you have a moment, can you please confirm that following is the correct procedure that I am following to reproduce the bug?

https://user-images.githubusercontent.com/73429007/196224450-81f6f069-a30c-407a-9b6a-766360bd4f8b.mov

I assure you this has "ALLOW_SPEAK_TAGS": false,. LMK if I might be missing something.

Also, It could be more helpful if you can share your entire config.json file, so it's easy to investigate which config might have caused the issue. Thanks.

gavspav commented 1 year ago

Yeah that's correct. Here's the config.json. I had to zip it because of github. The only other thing I can think is that I have not incorporated some of your previous changes into the code?

config.json.zip

shreyas-jadhav commented 1 year ago

Upon looking the config it seems here, the DEFAULT_SPEAK_TAGS is not within uiConfig.speak.displayItems.

If i remember @hburgund suggested to still include them regardless of that, but setting them in draftRecording.tags causes issues as we don't have their full objects, but only the id's. We already push the DEFAULT_SPEAK_TAGS to final list while submitting. Therefore not setting them in draftRecording.tags should fix it: https://github.com/roundware/roundware-web-template/pull/11/commits/46d54e5411fda71e6eeb5ad7ea53de9ababe43a3

gavspav commented 1 year ago

Nope I just end up in a loop now where I can't get past the 'where are you recording today' screen.

hburgund commented 1 year ago

@gavspav, in order to debug effectively, we need to make sure we are both testing the exact same codebases. You mentioned that you have made other changes and have been cherry-picking recent changes instead of updating your entire codebase? Can you grab a fresh copy of the template code with @shreyas-jadhav's newest commits and see if that exhibits the issue as well? Either way, that will help us figure out how to get it fixed.

gavspav commented 1 year ago

Yeah I know I should definitely do that! I'll get back to yo

gavspav commented 1 year ago

Finally got around to that but the code doesn't compile. Guess this is the wrong place for that though. But I'm not sure where the right place. The forked repo doesn't seem to have a section to report issues.

gavspav commented 1 year ago

Yes this seems to work as expected with the developers fork