question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The action you're trying to perform (unnamed) can't be performed yet

See original GitHub issue

Hi! 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: screen shot 2019-01-11 at 15 23 37

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewlorenzcommented, Aug 25, 2020

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

1reaction
radexcommented, Jan 11, 2019

And when i build release for iOS, my app will stuck (not responding). Is this related with the warning?

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

Also, I have a question about multithreading. Is it multithreaded in React Native? Thanks!

Yes. Native database code runs in a separate thread from JS thread and main thread.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found