Fix libsqlSyncInterval parameter handling in openSync function#285
Conversation
…val' instead of 'syncInterval'
|
thanks a lot! |
|
The interval is now not throwing an error but it seems like it has no effect on syncing. For example, with the following code:
I would expect that we would write to our local libsql database and then every 5 seconds sync to the remote database hosted via Turso. Is my thinking correct? Also, always happy to help with a PR. |
I would expect the same. When offline is set to true the automatic synching doesn't happen. It does when the offline param is false. Did you find a solution for that @twelvearrays ? |
|
I believe the functionality is the following: libsqlOffline: true -> It does not use the sync internal. You have to manually sync. At least that is what I have figured out. I have moved to manual sync on writes. |
|
thanks 🙏 @twelvearrays - yes, I came to the same conclusion: manual syncing is the way. |
…fix/libsqlSyncInterval_value_undefined Fix libsqlSyncInterval parameter handling in openSync function
Fixed a bug in cpp/bindings.cpp where the code was checking for the property "libsqlSyncInterval" but then trying to read "syncInterval" instead. This mismatch caused the native code to attempt to read an undefined property, resulting in the JSI error.
This bug was likely introduced during the rename from syncInterval to libsqlSyncInterval in PR #272, where this specific line wasn't updated correctly. The fix ensures that the libsqlSyncInterval parameter is properly passed through to the native libsql configuration.