nioc / xmpp-web

Lightweight web chat client for XMPP server
GNU Affero General Public License v3.0
142 stars 20 forks source link

Caching issues #88

Closed Ppjet6 closed 1 year ago

Ppjet6 commented 1 year ago

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

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

nioc commented 1 year ago

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.

Ppjet6 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

nioc commented 1 year ago

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 commented 1 year ago

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

Click on icon then "Erase..." image

Ppjet6 commented 1 year ago

"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 commented 1 year ago

@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.