Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/flutter-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
grep -q "createEncryptedClient" crates/fula-js/pkg/fula_js.d.ts
grep -q "getDecrypted" crates/fula-js/pkg/fula_js.d.ts
grep -q "deriveKey" crates/fula-js/pkg/fula_js.d.ts
# Issue #36 — forest-cache invalidation must stay exposed for
# npm parity with the fula-flutter bindings.
grep -q "invalidateForestCache" crates/fula-js/pkg/fula_js.d.ts
grep -q "invalidateAllForestCaches" crates/fula-js/pkg/fula_js.d.ts
echo "All expected exports found!"

# Layer 1: ban panic-on-wasm stdlib time APIs at compile time.
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ name = "encrypted_upload_test"
path = "examples/encrypted_upload_test.rs"

[workspace.package]
version = "0.6.8"
version = "0.6.9"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/functionland/fula-api"
Expand Down
16 changes: 10 additions & 6 deletions crates/fula-client/src/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8934,13 +8934,17 @@ impl EncryptedClient {
/// Forces the next `load_forest` call to reload from storage.
/// Dirty (unsaved) entries are NOT evicted — call `flush_forest()` first
/// to persist changes before invalidating.
///
/// The dirty check and the removal are ATOMIC (`DashMap::remove_if`
/// holds the shard lock across both). The previous get-then-remove
/// shape had a TOCTOU window where a concurrent deferred put could
/// dirty the entry between the check and the eviction, silently
/// dropping the pending index entry — reachable now that issue #36
/// exposes this call to arbitrary app refresh paths running
/// concurrently with uploads.
pub fn invalidate_forest_cache(&self, bucket: &str) {
let is_dirty = self.forest_cache.get(bucket)
.map(|entry| entry.is_dirty())
.unwrap_or(false);
if !is_dirty {
self.forest_cache.remove(bucket);
}
self.forest_cache
.remove_if(bucket, |_, entry| !entry.is_dirty());
}

/// Invalidate all cached forests
Expand Down
Loading
Loading