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

fix: add studio-version param to studio URL to address cache issues #1182

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

Amzani
Copy link
Collaborator

@Amzani Amzani commented Feb 19, 2024

Fixes #1098

Note: The browser might cache old studio version that doesn't support 3.0.0

@Amzani Amzani changed the title fix: Studio cache issues fix: studio cache issues Feb 19, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@Amzani Amzani changed the title fix: studio cache issues fix: Studio cache issues Feb 19, 2024
@Amzani Amzani changed the title fix: Studio cache issues fix: studio cache issues Feb 19, 2024
@Amzani
Copy link
Collaborator Author

Amzani commented Feb 19, 2024

/au

wsServer.on('close', (socket: any) => {
sockets.splice(sockets.findIndex(s => s === socket));
});

server.listen(port, () => {
const url = `http://localhost:${port}?liveServer=${port}`;
const url = `http://localhost:${port}?liveServer=${port}&_sv=${studioVersion}`;
Copy link
Member

Choose a reason for hiding this comment

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

are you sure this is a solution? In linked issue nobody specified that 1.4.0 of CLI was used, and older version did not have latest studio

also where is this _sv param coming from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's not the most exciting solution, but we should find a way to completely disable the browser cache in the local HTTP server we are using to start Studio.

The issue happens for new CLI versions, even though we have the latest studio version.

_sv -> studio version.

Copy link
Collaborator Author

@Amzani Amzani Feb 21, 2024

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

oh crap 🤔

ok, so _sv has no meaning for studio really, it is just a hack to force "refresh".

I think it is good, also useful as it informs what studio version you are using.

This is why, what about using full name for the query param? so it is immediately clear what that is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@derberg done, you take a look?

@Amzani Amzani force-pushed the samz/fix-studio-cache-issues branch from 81b11cd to 03a0ce8 Compare February 27, 2024 09:04
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Amzani Amzani requested a review from derberg February 27, 2024 09:05
@derberg derberg changed the title fix: studio cache issues fix: add studio-version param to studio URL to address cache issues Feb 27, 2024
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

Great idea 👏🏼

@derberg
Copy link
Member

derberg commented Feb 27, 2024

/rtm

@asyncapi-bot asyncapi-bot merged commit e45af3e into asyncapi:master Feb 27, 2024
13 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.5.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Old version of Studio wrapped in CLI
3 participants