Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] CrudEntry data type mismatch on uploadData connector #553

Open
rossicler-hostalky opened this issue Apr 1, 2025 · 2 comments
Open

Comments

@rossicler-hostalky
Copy link

Hi, I have created a common lib with a connector to upload the data to my API, but when using this in my React Native app, the transaction data is not matching the CrudEntry type. This is more or less what I have setup to test:

const transaction = await database.getNextCrudTransaction();
console.log("data", transaction.crud);

TypeScript says the type of transaction.crud is CrudEntry[], but this is what I get from the console.log:
[{"data": [Object], "id": "67ebfcb34b14c2a8b140b4e5", "op": "PUT", "op_id": 4, "tx_id": 4, "type": "mytablename"}]

For this reason my upload is failing, due to expecting the data to be something like: "op is a CrudEntry"

const record = {
  table: op.table,
  id: op.id,
  op: op.op,
  data: op.opData,
};
@michaelbarnes
Copy link

Hey @rossicler-hostalky can you provide some version of the SDK and it's dependencies please? This feels like an older implementation.

@rossicler-hostalky
Copy link
Author

Hey @rossicler-hostalky can you provide some version of the SDK and it's dependencies please? This feels like an older implementation.

These are some of the related dependencies on my react-native project:

"@powersync/react-native": "^1.19.0"
"@powersync/drizzle-driver": "^0.4.0"
"@journeyapps/react-native-quick-sqlite": "^2.4.2"
"drizzle-orm": "^0.40.1"

This is the dependencies on my common lib:

"@powersync/common": "^1.25.0"

I also tried remove the usage from my common lib to make sure that wasn't the problem, but the issue persisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants