[Pkg-mozext-maintainers] BoF or Sprint while DebCamp or DebConf?

Ximin Luo infinity0 at debian.org
Thu Aug 2 04:13:00 BST 2018


Dmitry Smirnov:
> On Wednesday, 1 August 2018 2:27:00 AM AEST Ximin Luo wrote:
>>> I've updated dh_webext to touch manifest.json to the date of d/changelog,
>>> this avoids postinst. [..]
>> On second thoughts I am not sure if this helps. Dmitry do you know how
>> firefox reads these timestamps?
> 
> I don't know...
> 
> 
>> Does it only require the timestamp to be newer than the previous version?
>> In this case my addition to dh_webext is enough.
> 
> I wouldn't count on that. Sometimes it may be necessary to downgrade the 
> package...
> 
> Another scenario where it might not work is when broken package has been 
> cached - in such case re-installing it will not fix the problem.
> And it would hurt mainteiners the most: imagine you re-build the extension 
> package without changing changelog and Firefox just doesn't pick up your 
> changes - from my own experience I know how incredibly frustrating that might 
> be...
> 
> 
>> Or does it require the timestamp to be newer than the previous time it
>> checked the directory?
>> In which case my addition to dh_webext is not
>> enough, and we will need a postinst.
> 
> I think that's the case and it would be the safest assumption.
> 
> 
>> Is this behaviour documented anywhere by Mozilla?
> 
> Nothing I could find. However this behavior is apparent and reproducible if 
> you upgrade/downgrade the extension package. By experimentation I've found 
> that without touching manifest, Firefox does not reload updated addons (their 
> version stays the same) and there is nothing user can do from Firefox to 
> trigger refresh or drop extension caches.
> 

I did some more tests and I think we can rely on touch-during-the-build for now, and avoid touch-during-postinst. I did:

1. built tree-style-tab from current master, installed it
2. open firefox, check tree-style-tab preferences, direction says "RTL"
3. close firefox, edit [1] to say "RTLWTF" instead of "RTL", wait a few seconds, re-opened firefox (*), direction still says "RTL".
4. close firefox, run `touch -r [1] [2]`, re-opened firefox, direction now says "RTLWTF". note that the timestamp of manifest.json is now *earlier* than the time at which I performed (*).
5. close firefox, install original extension.deb (with old timestamp), re-opened firefox, direction now says "RTL" again

This sequence of events suggests that firefox is caching the timestamp of manifest.json and comparing it with the previously-stored value, and *not* "the time it previously checked the files". So downgrading also works with an older timestamp.

I agree it's a bit more annoying for maintainers to deal with edits like this, but we can hopefully document this more clearly somewhere. Avoiding postinst I think is a worthy enough goal to put up with this.

Ximin

[1] /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/treestyletab at piro.sakura.ne.jp/_locales/en/messages.json
[2] /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/treestyletab at piro.sakura.ne.jp/manifest.json


-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



More information about the Pkg-mozext-maintainers mailing list