Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove leading slashes from URI paths #2565

Merged
merged 2 commits into from
Aug 19, 2023
Merged

Conversation

elitree
Copy link
Contributor

@elitree elitree commented Aug 14, 2023

In order to allow for drift web setups where the app is served from a subdirectory, the leading slashes have been removed from the Uri.parse() calls.

Copy link
Owner

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's just keep using absolute paths for the WasmDatabase constructor and to use xOpen.

final fs = await IndexedDbFileSystem.open(dbName: dbName);
sqlite3.registerVirtualFileSystem(fs, makeDefault: true);

final wasmDb = WasmDatabase(sqlite3: sqlite3, path: '/app.db');
final wasmDb = WasmDatabase(sqlite3: sqlite3, path: 'app.db');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer that the path here and the one for xOpen stay absolute. These refer to the path within the virtual file system implementation and aren't resolved to anything by the browser.

(The default working directory we assume is / so both work, but this change is unrelated to the issue of not being able to load the worker and it's safer to use absolute paths)

Comment on lines +6 to +7
content on <http://localhost:8080>.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, good catch!

@simolus3 simolus3 merged commit 6d80244 into simolus3:develop Aug 19, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants