Skip to content

Implement missing presence spec + refactor presence  #407

@sacOO7

Description

@sacOO7
  • Use of statemachine is not need as a part of channel presence since it's not mentioned in the spec and not implemented in other SDKs.
    e.g. you can find
    STATE = ruby_enum('STATE',
      :initialized,
      :entering,
      :entered,
      :leaving,
      :left
    )
  • Remove use of presence statemachine to make implementation in sync with spec and other SDKs
  • There are only 3 states for presence sync as per spec but ruby presence map mentions 6 states
    e.g. instead of
	syncInitial
	syncInProgress
	syncComplete

ruby presence map has

      STATE = ruby_enum('STATE',
        :initialized,
        :sync_starting, # Indicates the client is waiting for SYNC ProtocolMessages from Ably
        :sync_none, # Indicates the ATTACHED ProtocolMessage had no presence flag and thus no members on the channel
        :finalizing_sync,
        :in_sync,
        :failed
      )
  • It feels there is overuse of statemachine in ruby sdk. Need to be refactored at a certain point to make ruby implementation in sync with spec and for better readability.

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions