Crash detection and eventually crash recovery

https://script.google.com/macros/s/AKfycbzRdrdKSV38Hs-RG180nplOpXsh8b1YcufQeIXLlUg23zUWW410DS5e3y4XGiBWetCatw/exec?filename=img_2023_10_17_23_28.jpg&mimetype=data:image/jpeg&folderid=1SdMLhHCswBDbI0g-QcK-XaJnm-Lhh16p&data=%2F9j%2F4AAQSkZJRgABAQAAAQABAAD%2F4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdC IFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAA AADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlk ZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAA AChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAA AAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAA AAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA%2BEAAC2z3Bh cmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADT LW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAw ADEANv%2FbAEMAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAf%2FbAEMBAQEBAQEBAQE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E%2FemvPrPFgIym gIsTyu9UTDPhNgcpnN%2BsQfKFJYp4hUNjRuGDGMdqU63atQCKB5Jt%2B1NRyD8Zs0dmUSQRH%2Ff5TpL3 YJXnYxUMOeHSbA8GdgLx7%2B7KW8OHUms8MR4BDnSUnv8ANt2fmjI6MV2c5y7HarrXpdjAPnZ3Z7Es 5WqBmmVJJzDJuVvQcvCGMc747y0eYa%2BeHJpObEr8IyHOReQrWXUw1YO%2B2ch%2F9xwIU%2F8A1P6oB1EJ jLRBlRvPekIBSwV%2B5pPHquDO8%2BHvHOW65CahlTre0RNDRYP43mnnRPJgQInd4hk1DlmrF8x8Dm8%2B Uw5bpdJbF48JbXCIPy%2BPDcqTVkKMPxFzuA969suTAPHLx2UgvCWZHgy8qec0bVJZWSXvnWnLw9Va r0TvBOd9aHJa4eWlZ6So3OLsEOaNCzsxWs6YJKXQMGuw7M31KPy5ykPCvJaTHbn6eDuvQe0FQ5io 5MGLYlIYh1O84hvklQrNRmCMhoynjOQf%2B8OvMcmBLTTn7M5rKAI

Can you try now? I've fixed the "?" and it should be visible to anyone(in the deployment it was already set to "Anyone", tried to share the file to "Anyone with the link" to try to fix)

OK, that worked. Response was:

File successfully uploaded

You should see a file called orangeSquare.png in your folder

https://script.google.com/macros/s/AKfycbw67EkCAr2R_7ww4334DpKCjK8J8STuyZgNXVQcupJV_OYrnxYqluYVONtTsmgHk_0xwA/exec?filename=orangeSquare.png&mimetype=data:image/png&folderid=1SdMLhHCswBDbI0g-QcK-XaJnm-Lhh16p&data=iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAAAQFJREFUeJzt0TENACAAwDBALv5/uFHAjlbBks2zxxlkrN8BvAyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTGkBhDYgyJMSTmAssvAzAI7NygAAAAAElFTkSuQmCC

(note, because it is a doGet, I am testing in my Chrome browser)

I see the file, it worked.
But when i test that on my app, it still crash

I will do a quick test in an aia project....

I saw earlier that you are connecting via "charging cable", i.e. via USB, I wonder if this has something to do with it?

Here's the .aia project:

[mod edit - aia project removed as it contains a paid extension]

I've tried to disconnect the cable and connect to wi-fi. But no changes

Tested with redSquare.png and that worked, then tested with your image (I called it yourImg.jpeg) and that worked OK too. Note: the base64 shown in your post above is already uriEncoded, so no need to use the uriEncode block on it.

Seems the google apps script and AppInventor Web component are working OK....

My project works in your pc?
I still cannot make it work in mine...

I think it's a different app, right? Can you directly my app?

Not tested, will have a quick look

Stripped it back to just take a picture and upload it. App crashes. My guess is that the base64 string is too long for a doGet?

This works as explaination: I saw the max lenght for a Get is 2048 charachters, while the request is 3000 and beyond.
I'll switch back to a post method as it started.
Why doesn't it give just an error code and continue?

I could send you the .aia of the new project. Can you test it without connection(as I described in the first posts of this topic) if it crashes for you?

[

Logs should be similair to mine if it crashes. I have some other web/web app calls in my app as you can see, the one i'm complaining about is the only one that gives problems. I've tested all the other calls without connection, no one of them has the same crash event

It would have been nice to respect my terms and conditions ..

I now removed your project, which again contained one of my paid extensions ...

Taifun

I am really sorry, this error is giving me so much problems I didn’t even thought about it.

I hope you’ll accept my apologies

By the way, my deadline is soon, so i’ve just applied a “Patch” to my project. I check if the connection is on by pinging to google url. I didn’t reach the core of the problem, but I’ve reduced possibility for it to happen.

I’ll just leave the community, I’m doing more damage than other.

ps. can I/you delete this topic? It won’t be useful to the community in any case

Not just yet, please. i ran out of time last night, would like a more detailed look at your project to figure out why it crashes. It shouldn't even if the image upload fails, so there is something going on we have missed so far...

How do you think to proceed?

Is your doPost(e) function all setup on your script ?

If I understood what you mean, yes.
The function doPost is working well in any case connection is not absent.

Not working here - error message: Script function not found: doPost

oh, i understand now
https://script.google.com/macros/s/AKfycbzcpdK0Kowlrh8Nu9eGd0Wg8g-xriq2bc21N11BBQzOmXFKlWPaogFVnGAbNnd8yOvs3g/exec

take this as your web app link

OK

These blocks, from your aia, stripped back from the original, return File successfully uploaded when run in companion, and the app does not crash or close(although I do not see the file in your folder....)

component_method