Skip to content

fix: Fix function in resource fetcher that produced the same name for different requires in development mode#396

Merged
pweglik merged 1 commit intomainfrom
@pw/fix-resource-fetcher-filename
Jun 13, 2025
Merged

fix: Fix function in resource fetcher that produced the same name for different requires in development mode#396
pweglik merged 1 commit intomainfrom
@pw/fix-resource-fetcher-filename

Conversation

@pweglik
Copy link
Copy Markdown
Contributor

@pweglik pweglik commented Jun 13, 2025

Description

When loading two models using require the 2nd would overwrite the 1st one, cause this function produced the same name for them. It worked for remote URLs that were different in path part (the one divided by slashes), but locally loaded files only differ by GET params, that were cut off by split('?')[0]. This fixes it.

It might be considered breaking change in a sense it may change names of models in the current app, so models will redownload

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improves or adds clarity to existing documentation)

Tested on

  • iOS
  • Android

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

@pweglik pweglik self-assigned this Jun 13, 2025
@pweglik pweglik changed the title Fixed function in resource fetcher that produced the same name for different requires in development mode fix: Fix function in resource fetcher that produced the same name for different requires in development mode Jun 13, 2025
@pweglik pweglik merged commit 189fa97 into main Jun 13, 2025
2 checks passed
@pweglik pweglik deleted the @pw/fix-resource-fetcher-filename branch June 13, 2025 13:10
mkopcins pushed a commit that referenced this pull request Oct 15, 2025
… different requires in development mode (#396)

## Description

When loading two models using require the 2nd would overwrite the 1st
one, cause this function produced the same name for them. It worked for
remote URLs that were different in path part (the one divided by
slashes), but locally loaded files only differ by GET params, that were
cut off by split('?')[0]. This fixes it.

It might be considered breaking change in a sense it may change names of
models in the current app, so models will redownload

### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Documentation update (improves or adds clarity to existing
documentation)

### Tested on

- [ ] iOS
- [x] Android

### Checklist

- [x] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly
- [x] My changes generate no new warnings
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