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

WIP Presence continuation #3

Open
wants to merge 225 commits into
base: sync-presence
Choose a base branch
from

Conversation

curran
Copy link

@curran curran commented Apr 19, 2019

Creating this PR just to check how this PR https://github.com/share/sharedb/pull/288/files has diverged from the original share#207 .

Note: the latest work on presence from me is in this PR here share#288

mbalex99 and others added 30 commits January 26, 2017 14:11
Reconnecting Websocket Example and Updated Readme
This is a slightly speculative fix for a test that fails intermittently
on `sharedb-mongo`. I believe these intermittent failures are due to a
race condition in a concurrency test.

The test works by attempting to fire two commits off at the same time,
and hoping that one of them is committed just before the other, so that
a `SubmitRequest.retry` is triggered whilst the `maxSubmitRetries` is
set to `0`, resulting in an error that is expected.

However, I believe it's possible for these commits to (in some cases)
happen sequentially rather than concurrently, and fail to error.

This change attempts to force them into this retry condition by:

  - Catching both ops in the `commit` middleware, _just_ before they're
    about to be committed (and hit a `retry` if applicable)
  - Waiting until both ops have reached this state
  - Triggering the first op's `commit`
  - Then in the callback of that op, triggering the second op's `commit`
  - The second op should now find that the first op has beaten it to
    committing, and trigger a `retry`
Add note about projectsSnapshots property
Remove sharedb-mingo-memory circular dependency
…ures

Warn about using deprecated features
@curran curran mentioned this pull request Apr 19, 2019
curran and others added 22 commits April 20, 2019 00:25
in chrome 51, will throw error
Uncaught TypeError: Illegal invocation
fix: Uncaught TypeError: Illegal invocation in chrome 51
Update rest of examples to @teamwork/websocket-json-stream
Fix broken status indication in textarea example
The database adapters allow an `options` object to be passed through to
them for enabling the return of metadata with a snapshot or ops.

Consumers could query the database directly, or even use the database
adapters, but this may give inconsistent results when comparing ops with
those fetched through `getOps`. For example, the Mongo adapter makes
sure that a valid set of ops with unique versions are returned, which
may not be the case when querying the database directly. Fetching ops
and snapshots through `Backend` methods also ensures that we call the
appropriate "sanitize" methods, and trigger the corresponding
middleware.

However, we don't expose this on `Backend.getOps` or `Backend.fetch`.
This change adds an optional `options` argument to these methods, which
can then be used to ask for metadata.

Note that an options argument has been added to `Backend.subscribe`, but
using it will return an error. This is to keep the signature consistent
with `fetch` and `getOps`. However, the implementation is beyond the
scope of this change, because we'd need to add some way to configure
`SubmitRequest.commit` to optionally pass metadata to the appropriate
clients, who provided that given option on `subscribe`.
Allow options to be passed for `fetch` and `getOps`
This change addresses three things:

  1. Move us from `jshint` to `eslint` (which is the more commonly used
     linter)
  2. Fix our linting glob patterns, which currently only address files
     at the top of their respective directories (and ignore all files in
     subdirectories)
  3. Enforce stricter linting rules, based roughly on the [Google][1]
     rules

[1]: https://github.com/google/eslint-config-google
Large indentation fixes were skipped in the previous commit in order to
keep the diff a bit less noisy. This change purely removes the eslint
ignore comments, and fixes the indentation in those files.
This change actively extends the Google ESLint config. We move the
config into a `.js` file so that we can add comments about particular
rules that we've overridden.

This change also fixes some trailing comma and indentation linting
errors.
This change uses our `.gitignore` file to define which files ESLint
should ignore, so that all of our committed JavaScript has a consistent
style.
This change makes some linting review markups:

  - pre-comupte long, concatenated strings
  - only allow one statement per line
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.