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

Dexie Cloud licensing support #1785

Merged
merged 28 commits into from
Oct 18, 2023
Merged

Dexie Cloud licensing support #1785

merged 28 commits into from
Oct 18, 2023

Conversation

dfahlander
Copy link
Collaborator

Support for end-user evaluation licenses (see blog post about the new subscription model)

* Handle error response from token endpoint
* Update literal types: add 'client' license type as declared in dexie-cloud-common.
* Don't show cancel button on alert messages
* Auto-submit OTP when 8 characters are entered
* Improve typings in defaultUI
+ allow token endpoint to send error instead of tokens
Don't connect websocket if license expired
* Don't throw if license is invalid.
* Let expired/invalid user login and pull data (but not sync changes)
* Allow change user without logging out first
* db.cloud.logout() - logs out current user.
* Request confirmation in case there are unsynced changes on logout
Instead, if there's already a scheduled retry, cancel that one when scheduling a new retry
* Warn if license is about to expire
* Inform user is in offline mode if license is expired
* Advertise to purchase a subscription if expired or about to expire
* If expired, allow user to delete themself completely from the system.
* If only 50% of remaining is left, stall next sync until (reset / remaining) seconds
* Bugfix - used registerSyncEvent() instead of triggerSync() - would only work in production with SW active.
* Simplify performGuardedJob() using navigator.locks.
Javascript is a bit unsuprisingly forgiving when passing array of string instead of a string:
```js
const obj = {id: 1}
Object.hasOwnProperty(obj, "a"); // returns true as expected.
Object.hasOwnProperty(obj, ["a"]); // Also returns true (!)

obj["id"] // returns 1 as expected.
obj[["id"]] // also returns 1 (!)

```
This commit makes sure to check typeof keyPath before passing it to getOwn() (alias for `(x, a) => Object.prototype.getOwnProperty.call(x, a))``
@dfahlander dfahlander merged commit 879982d into master Oct 18, 2023
5 checks passed
@dfahlander dfahlander deleted the dxc-licensing branch October 18, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant