Skip to content

GDK causing rusqlite_migrate error in Breez SDK #3

@BlakeKaufman

Description

@BlakeKaufman

Description
When using the Breez SDK alone in a project it can connect to the node fine, however, when you download the GDK in a project with the Breez SDK it causes an error in the Breez SDK connection.

Here is a test app where you can reproduce the error: BreezTestApp Make sure to add an npmrc file to download the GDK + greenlight certificates and API key.

Project dependencies to reproduce. Error is also produced from RN version 0.72.10.
{
"name": "breezTest",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@breeztech/react-native-breez-sdk": "^0.5.0",
"@dreson4/react-native-quick-bip39": "^0.0.6",
"@vulpemventures/react-native-gdk": "^0.0.5",
"react": "18.2.0",
"react-native": "0.74.4",
"react-native-build-config": "^0.3.2",
"react-native-quick-base64": "^2.1.2",
"react-native-quick-crypto": "^0.7.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.74.86",
"@react-native/eslint-config": "0.74.86",
"@react-native/metro-config": "0.74.86",
"@react-native/typescript-config": "0.74.86",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}

Error being shown

[Error: Generic: rusqlite_migrate error: RusqliteError { query: "\n ALTER TABLE payments RENAME TO old_payments;\n\n CREATE TABLE IF NOT EXISTS payments (\n id TEXT NOT NULL PRIMARY KEY,\n payment_type TEXT NOT NULL check( payment_type in('Sent', 'Received', 'ClosedChannel')), \n payment_time INTEGER NOT NULL, \n amount_msat INTEGER NOT NULL,\n fee_msat INTEGER NOT NULL, \n pending INTEGER NOT NULL,\n description TEXT,\n details TEXT\n ) STRICT;\n \n INSERT INTO payments\n (id, payment_type, payment_time, amount_msat, fee_msat, pending, description, details)\n SELECT \n payment_hash, \n case when payment_type = 'received' then 'Received' else 'Sent' end, \n payment_time, \n amount_msats,\n fee_msat, \n pending, \n description, \n json_object(\n 'payment_hash', payment_hash, \n 'label', label, \n 'destination_pubkey', destination_pubkey, \n 'payment_preimage', payment_preimage, \n 'keysend', CASE keysend WHEN 1 THEN json('true') ELSE json('false') END, \n 'bolt11', bolt11\n )\n FROM old_payments;\n \n DROP TABLE old_payments; \n ", err: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("SQL logic error")) }]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions