Skip to content

feat: add browser-safe js file util shims [WPB-23964]#4010

Open
Garzas wants to merge 1 commit intodevelopfrom
kubaz/feat/js-runtime-fileshim
Open

feat: add browser-safe js file util shims [WPB-23964]#4010
Garzas wants to merge 1 commit intodevelopfrom
kubaz/feat/js-runtime-fileshim

Conversation

@Garzas
Copy link
Copy Markdown
Contributor

@Garzas Garzas commented Apr 1, 2026

https://wearezeta.atlassian.net/browse/WPB-23964


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • Some JS runtime helpers still assumed native filesystem behavior.
  • On web, this could lead to unsupported file operations and incorrect persistent-storage cleanup.
  • JS tests also needed an IndexedDB bootstrap in the Node-based test environment.

Causes (Optional)

  • Native targets use file-based storage, while web uses browser-managed storage like IndexedDB.
  • The existing JS helpers were either unimplemented or too close to native filesystem semantics.
  • The shared FileUtil API had no web-specific persistent cleanup path.

Solutions

  • Added deletePersistentDirectory(...) to the shared FileUtil API.
  • Implemented the JS version using IndexedDB cleanup.
  • Mapped the new API to existing directory deletion on native targets.
  • Replaced unsupported web filesystem helpers in CoreCrypto with safe inert shims.
  • Added a one-time warning log for unexpected JS filesystem shim usage.
  • Added an IndexedDB bootstrap for JS tests.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Test Results

0 tests   - 4 718   0 ✅  - 4 601   0s ⏱️ - 2m 45s
0 suites  -   779   0 💤  -   117 
0 files    -   779   0 ❌ ±    0 

Results for commit cbeb734. ± Comparison against base commit 55fa770.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🐰 Bencher Report

Branchkubaz/feat/js-runtime-fileshim
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
891.97 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
340,636.54 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
132,791.12 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
126,700.44 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.localMarkAsReadBenchmark📈 view plot
⚠️ NO THRESHOLD
3,836.42 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
26,984.96 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
11,428.69 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,375,111.68 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,606.23 µs
🐰 View full continuous benchmarking report in Bencher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant