Wappler Version: 6.1.1 Stable and Beta
Operating System: Windows 11
Server Model: Capacitor
Database Type: SQLite
Expected behavior
The Capacitor SQLite Update action should work
Actual behavior
The Capacitor SQLite Update action does not work.
Details during investigation
I added alerts into this app flow to ensure it was making it into the repeat named labelsAdded
.
Step 1 : This alert runs in the labelsAdded
repeat and logs the repeat’s values. I wanted to validate that message.id
had a value. It did, so the action in Step 2 should find a record to update.
Step 2 : This condition is checking for the updated record from the Capacitor SQLite Update: addLabels_SQLite
action.
Step 3 : If there was a record updated in Step 2 then we should get another alert. This alert never fires which means the record update did not run.
Hi @George or @Teodor , could this be assigned for review? I’m working on use cases in my app where I need to perform database updates, but can’t proceed with development due to this bug.
Here’s another App Flow where the update is not working.
patrick
January 23, 2024, 10:33am
4
Did you get any JavaScript error? Perhaps place the update in a try/catch to see if it throws some error.
There are no errors in console. I do not see a try/catch in App Flow within a mobile project.
The App Flow component should return data or a lastError when an error occurred, can you check if the lastError was set?
Apologies, I have two similar flows and I was triggering the wrong one.
So, the database update fails when I try to set a json array field.
If I remove the json field then the update is successful.
Here’s the error it’s throwing saying no such column: undefined
.
dmxAppConnect.js:7
Error: Error invoking remote method 'CapacitorSQLite-run':
Error: RUN failed:
Error: RunSQL:
Error: PrepareRun
runExec: no such column: undefined
(anonymous) @ dmxAppConnect.js:7
Promise.catch (async)
run @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
Promise.then (async)
run @ dmxAppConnect.js:7
run @ dmxAppConnect.js:7
Object.keys.forEach.data.<computed> @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
dmx.parse @ dmxAppConnect.js:7
dmx.parse @ dmxAppConnect.js:7
parse @ dmxAppConnect.js:7
run @ dmxAppConnect.js:7
_execStep @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
Promise.then (async)
(anonymous) @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
Promise.then (async)
_each @ dmxAppConnect.js:7
_exec @ dmxAppConnect.js:7
run @ dmxAppConnect.js:7
dmx.Flow.run @ dmxAppConnect.js:7
run @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
dmx.parse @ dmxAppConnect.js:7
(anonymous) @ dmxAppConnect.js:7
a @ dmxAppConnect.js:7
dispatch @ bundle.js?ver=3.2.0:1
m.handle @ bundle.js?ver=3.2.0:1
I have no issue using a Capacitor SQLite Insert on the same column, so not sure why the update action breaks.
I’m an idiot! Sorry for the review cycles.
I forgot I need to wrap the json.