WICG / background-sync

A design and spec for ServiceWorker-based background synchronization
https://wicg.github.io/background-sync/spec/
Apache License 2.0
641 stars 83 forks source link

nit: minimum periodic sync intervals are times, not just integers #171

Open jyasskin opened 4 years ago

jyasskin commented 4 years ago

https://wicg.github.io/BackgroundSync/spec/PeriodicBackgroundSync-index.html#constants defines "minimum periodic sync interval for any origin" and "minimum periodic sync interval across origins" as "long long"s, and then they're used as "Wait for minimum periodic sync interval across origins.". One can't wait for a long long; one waits for that number of milliseconds. So the constants could be defined as "a long long number of milliseconds" or, since they're never actually exposed to JS as far as I can tell, they could just be defined as "a time interval".

othermaciej commented 4 years ago

It's pretty weird that this is milliseconds, since the expected time granularity is more like hours or days, but I suppose it aligns with setTimeout.

jyasskin commented 4 years ago

(The other day I learned that this is called "scalar implicature".)

I subsequently filed https://github.com/whatwg/infra/issues/280 to see if we should encourage spec authors to talk in terms of "X hours" instead of defaulting to the only time type the platform currently has, DOMTimeStamp, an unsigned long long number of milliseconds.