The action you're trying to perform (unnamed) can't be performed yet
See original GitHub issueHi! I Just discover this project and it’s amazing! 🥇
I have several question about implementation to my project. So, I have function like this:
export async function asyncSaveOfflineDb (...) {
// get watermelon database name from Repo databaseName
// use it for db transaction
const dbConv = getDatabaseName(databaseName)
if (dbConv) {
// get collection based on dbName
const collection = database.collections.get(dbConv)
try {
// do watermelon database action
await database.action(async () => {
// Get data from DB. If no data saved yet, willUpdateData will be empty / null.
const willUpdateData = await collection.query(
Q.where('id', '' + rawData.id)
).fetch()
// if willUpdateData is null, means data not in local DB
// So create new DB based on raw data.
if (!willUpdateData || willUpdateData.length === 0) {
const newData = await collection.create(data => {
// this allow us to passing data instead off declaring variable one by one.
// pass all data to selectNormalize function,
// and function will return data that suitable with the schema.
data._raw = sanitizedRaw(selectNormalize(..., rawData), collection.schema)
})
console.log('CREATED data', newData, rawData)
} else {
// if willUpdateData is not empty, UPDATE THE DATA
await willUpdateData[0].update(data => {
data._raw = sanitizedRaw(selectNormalize(..., rawData), collection.schema)
})
console.log('UPDATED Data', willUpdateData, rawData)
}
})
} catch (err) {
console.log('ERORR UPDATE DATA', err, rawData)
throw err
}
} else {
console.log('DB not found or registered', databaseName)
}
}
After several time trying, i got this warning message:
And when i build release for iOS, my app will stuck (not responding). Is this related with the warning?
Here is the first line error trace:
2019-01-11 15:27:24.265631+0800 rn_travlr[659:31471] Task <C86AB59B-8B96-4F93-8116-0910C3CCE8C3>.<57> finished with error - code: -999
2019-01-11 15:27:25.381613+0800 rn_travlr[659:31471] -[__NSCFNumber length]: unrecognized selector sent to instance 0xb0001683bcef4c53
2019-01-11 15:27:25.383 [fatal][tid:com.facebook.react.AsyncLocalStorageQueue] Exception '-[__NSCFNumber length]: unrecognized selector sent to instance 0xb0001683bcef4c53' was thrown while invoking multiSet on target AsyncLocalStorage with params (
(
(
lastSync,
1547191645381
)
),
24003
)
Also, I have a question about multithreading. Is it multithreaded in React Native? Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Troubleshoot issues when starting or launching an EC2 instance
The UnauthorizedOperation error indicates that the user attempting to launch the instance doesn't have the required permissions. For information ...
Read more >Unknown column in 'field list' error on MySQL Update query
I keep getting MySQL error #1054, when trying to perform this update query: UPDATE MASTER_USER_PROFILE ...
Read more >Why does my console account say it is already linked to an ...
A nameless account is when your console account is linked to an Epic Games account without an email, password, display name, and first...
Read more >Safely open apps on your Mac - Apple Support
The safest place to get apps for your Mac is the App Store. ... If you still want to open an app for...
Read more >Troubleshooting app protection policy user issues
They are not actual issues, but may be perceived as bugs or errors. ... To complete this action, sign in with your work...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
its hard to see how not enabling actions (assuming that actionsEnabled does indeed do what it says it does!) would fix a problem with performing an action. Its also apparently mandatory to set actionsEnabled when initialising the database connection, so I’m now struggling to resolve the same error as the OP
It is. The warning explains why the app appears stuck. Take a look at the docs: https://github.com/Nozbe/WatermelonDB/blob/master/docs/Actions.md
Yes. Native database code runs in a separate thread from JS thread and main thread.