Important changes to Tiny Cloud pricing > Find out more

Troubleshooting information for the RTC plugin

Useful information for troubleshooting issues with the RTC plugin.

Contribute to this page

This documentation is in progress. Please contact us with any suggestions you think should be here.

What happens if two clients attempt to establish a session at the same time? How does that impact on encryption key generation?

As noted in the Document ID configuration option, if a document ID is not known to the server, new initial data will be uploaded. If two users manage to do this at the same time, one will be forced to wait for the other to establish the session. This has implications for configurations using a dynamic rtc_encryption_provider.

If the situation occurs, the connection process for the RTC plugin will be as follows:

  1. Both plugins request a session for the document ID, and the server does not have an existing session.
  2. Both plugins use the encryption provider to produce an encryption key with no key hint to encrypt the initial content.
  3. Both plugins send a “create session” request to the server.
  4. One connection “wins”, and the other is “rejected”.
  5. The rejected connection waits for further instructions.
  6. Once the winner completes establishing the session, the server broadcasts “new session available” to all clients connected for the same document ID. This message will include the key hint from the winning encryption key.
  7. The rejected connection uses this key hint to generate the same encryption key as the winning connection and collaboration begins.

As a result of this process:

  1. If encryption keys are dynamic, old keys cannot be discarded immediately when a new key is generated.
  2. For any given key hint, the same encryption key must be returned every time.

Care must be taken to avoid losing encryption keys to this race condition.

Server reports JWT authentication was issued in the future

JWT is a very strict protocol. If the computer that signs the JWT has a clock that is significantly ahead of the server clock, and tokens are signed on demand, this error can occur.

To resolve this issue ensure all computer clocks are synchronised using NTP or a similar service.

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.