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

Caching issues #88

Closed
Ppjet6 opened this issue Feb 3, 2023 · 9 comments
Closed

Caching issues #88

Ppjet6 opened this issue Feb 3, 2023 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Ppjet6
Copy link
Contributor

Ppjet6 commented Feb 3, 2023

Describe the bug

When updating xmpp-web code, a proper refresh is needed to get the new features.

For example, I think this is related, I was presented the login form today for some time (no clue why), until I finally managed to completely clear Firefox's cache ("Forget this website") so it shows me the anon nickname form again.

Or a simpler update to local.js (extending pinned mucs) wouldn't be taken into account until Ctrl+Shift+R was pressed.

Steps to reproduce

  • Make a change to local.js
  • Open the page

Expected behavior

Everything looks as it was before expect for the added features and fixed or added bugs :)

I guess most of the time this shouldn't be an issue, but there's been quite a few changes lately and thus quite a few releases (and that's great!), but it may be confusing for users to s

Relevant log

No response

local.js configuration

// eslint-disable-next-line no-unused-vars, no-var
var config = {
  name: 'XMPP web',
  transports: {
    websocket: 'wss://chat.joinjabber.org/xmpp-websocket',
    bosh: 'https://chat.joinjabber.org/http-bind',
  },
  hasGuestAccess: true,
  hasRegisteredAccess: false,
  anonymousHost: 'anon.joinjabber.org',
  isTransportsUserAllowed: false,
  hasHttpAutoDiscovery: false,
  resource: 'Web XMPP',
  defaultDomain: 'anon.joinjabber.org',
  defaultMuc: 'joinjabber.org',
  isStylingDisabled: false,
  hasSendingEnterKey: true,
  pinnedMucs: ["chat@joinjabber.org", "support@joinjabber.org", "servers@joinjabber.org"],
}

// xmpp-web version: 0.9.7

XMPP-web version

0.9.7

Installation

Github release archive

XMPP server(s)

Prosody IM

Browser(s)

Firefox

Device(s)

desktop

Other information

No response

@Ppjet6 Ppjet6 added the bug Something isn't working label Feb 3, 2023
@Ppjet6 Ppjet6 changed the title Caching issues when updating versions Caching issues Feb 3, 2023
@nioc
Copy link
Owner

nioc commented Feb 3, 2023

Hello, I probably made a misuse in vite PWA plugin which cache all assets, including local.js.

On another Vue project, I have set up a more complex configuration which allow to configure what cache strategy use according to asset url (vite.config.js and service-worker.js). At least I can use the same here.

@nioc nioc added this to the 0.9.8 milestone Feb 3, 2023
@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 3, 2023

It's not just local.js, I used it as an example, it really looks like it's the whole project. This also happens when updating the project to a new release

@nioc
Copy link
Owner

nioc commented Feb 3, 2023

At build step, rollup create a hash for each file (except local.js) and put them in manifest for PWA/service-worker caching.
So it should be ok if I set a valid plugin configuration and catch it the Vue part.
local.js should be cached but with a network first strategy.

@nioc
Copy link
Owner

nioc commented Feb 3, 2023

I just see that the font used for icons /assets/forkawesome-webfont.<hash>.woff2?v=1.2.0 is not cached (too bad as it is about 110 KB).
To be fixed too.

@virtadpt
Copy link

virtadpt commented Feb 3, 2023

I get the same problem. Haven't found the "Forget this website" Firefox button yet.

@nioc
Copy link
Owner

nioc commented Feb 3, 2023

As a workaround, Ctrl + Shift + Del -> keep only "Offline website data" checkbox (not as seen in screenshot, but for locating the checkbox on the bottom):
image

Then F5

@nioc
Copy link
Owner

nioc commented Feb 3, 2023

@virtadpt If you do not want to clear all offline data:

Click on icon then "Erase..."
image

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Feb 3, 2023

"Forget this website" is certainly quite a radical method. It's available in the history menu, find the website you want to forget and right-click on it, close opened tabs for this website and restart the browser.

@nioc nioc self-assigned this Feb 3, 2023
@nioc nioc closed this as completed in 548e8d2 Feb 3, 2023
@nioc
Copy link
Owner

nioc commented Feb 3, 2023

@Ppjet6 @virtadpt 🚀 0.9.8 released!

You'll a need a last Ctrl + F5 to refresh all the js file, but after that, it should be ok, reopen this issue if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants