* Fix handling of non-monotonic timestamps
Timed version is inspired by Hybrid Clock. We used to have a mixed behavior
by using time.Time:
* during local comparisons, it does increment monotonically
* when deserializing remote timestamps, we lose that attribute
So it's possible for two requests to be sent in the same microsecond, and
for the latter one to be dropped.
To fix that behavior, I'm switching it to keeping timestamps to consolidate
that behavior, and accepting multiple updates in the same ms by incrementing ticks.
Also using @paulwe's idea of a version generator.
* Do not hold lock while invoking resolver.
Resolver is in room and it will grab its lock.
It is called from partcipant when checking permissions.
Permissions processing uses the participant lock.
So, not a good idea to call a room function with
participant lock held. Avoid that.
Also, use a full lock in the add/remove subscription
path. This is to ensure that permissions path and
subscription path (like subscribing to new participant's
tracks) do not race. As subscriptions are queued now
on the subscriber side, this should be fine.
* Revoke path resolution in ops queue goroutine
* fix test
* Support participant identity in permissions
It is harder for clients to update permissions by SID as remote
reconnecting means a new SID for that participant. Using participant
identity is a better option.
For now, participant SID is also supported. Internally, it will
get mapped to identity. Server code uses identity throughout after
doing any necessary conversion from SID -> Identity.
* Address comments
* WIP commit
* Add some tests
* allowedSubscribers uses participant sid
* correct variable name
* correct another variable name
* Add ParticipantSid to SubscriptionPermissionUpdate message
* protocol v0.11.2
* WIP commit
* WIP commit
* fix tests
* Remove unused code
* Close uptrack manager
* Remove duplicate close
* move comment to the correct line where the loop could be long
* Fix disallowed list revocation, thank you Jie
* Remove unneeded interface method
* RemoveSubscriber in Participant
* Clean up disallowed subscriptions and handle permissions on new track addition
* add test for track addition after permission set
* Remove unnecessary check