Skip to content

Commit 5d57b62

Browse files
committed
plan for fixing #380
1 parent e62bdc3 commit 5d57b62

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/rs/core/src/db_version.rs

+11
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ pub fn next_db_version(
6666
if let Some(merging_version) = merging_version {
6767
if ret < merging_version {
6868
ret = merging_version;
69+
} else if ret > merging_version {
70+
// if merging_version has never been seen before
71+
// in this current transaction against `crsql_changes`
72+
// we need to bump ret
73+
// We can accomplish this by:
74+
// 1. Installing a `xBegin` callback on `crsql_changes` which indicates we are writing there
75+
// 2. Install `xCommit` and `xRollback` callbacks on `crsql_changes` indicating we are done writing there
76+
// 3. Adding a Vec of `db_versions` to extData
77+
// 4. Binary search this vec for the current merging_version
78+
// 5. If not there, add it and bump ret.
79+
// 6. If there, do nothing.
6980
}
7081
}
7182
unsafe {

0 commit comments

Comments
 (0)