Code Monkey home page Code Monkey logo

docs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Review needed

@paddybyers and @kouno, please can you review my changes in the docs repo over the last few days, see 8a62a69...source

The biggest chunks of work are:

  • Reorganisation of the client library developer guide sections with lots of new content
  • Support for wider variable interpolation within code examples
  • Update of out of date documentation include Authentication, WebSocket & Comet transports, Encryption, Real-time Protocol, REST API etc. I am focussing on this now because I want to help client lib developers by having docs that are up to date. @paddybyers especially, please can you review my changes as it's quite likely there are still parts that are wrong. I am less worried about missing docs however quite worried if the docs are wrong.
  • I set up the Quick Start Guide as a test to see if I could get the "Try it" live code editor working again properly with our JSBin. This all works now and the workflow is actually quite easy, you can either work in repo itself and the changes to JSBin are pushed up live when running guard, or you can edit in JSbin and then export back to docs by appending .textile to the URL in JSBin.

Please can you review these changes as soon as possible as I will be telling all client library developers that the documentation in those sections is now mostly up to date.

@kouno we are also now ready to get going with integrating our examples into the docs repo.

Document any and all limits

For example, how long we retain messages when a connection is dropped, or how many messages can be retained by the connection state on a frontend, total messages per second, message size etc.

┆Issue is synchronized with this Jira Task by Unito

Question about RTP8g (presence#enter on a DETACHED channel)

So RTP8g says that the client lib, for Presence#enter, Raises an exception if the channel is DETACHED or FAILED.

This seems inconsistent with other actions that trigger an implicit attach (eg channel#publish), for which the client lib triggers an implicit attach for a detached channel just as for an initialized one. Presence#enter is the only action that has both an Implicitly attaches to the channel if not attached and a Raises an exception if the channel is DETACHED or FAILED requirement (the only other action that has the latter is Presence#get, which does not have an implicit attach requirement).

Current client lib behaviour: ably-js treats detached and initialized channels the same for all of these, and implicitly attaches. Ably-ruby has all presence broadcast-type actions raising an exception if called on a detached channel.

Not obvious to me why implicit attaching should behave differently between presence actions and others.

(Also for realtime presence#get: if we don't want to make it an implicit-attach action, shouldn't it raise an exception if in any state other than attached, not just detached or failed?)

Versioning

We don't currently support versioning in the documentation.

Once all libraries reach 0.8 compatibility, we will need to review how we can publish updates to the docs, but allow people to access older versions.

@paddybyers, @SimonWoolf and @kouno FYI, something to think about in the near future.

Encoding / decoding rules should be documented for client library developers

For example:

JSON format

String payload -> encoding = ""
Binary payload -> encoding = "base64"
JSON payload -> encoding = "json"
Cipher JSON payload -> encoding = "json/utf-8/cipher+aes-128-cbc/base64"

MSGPACK format

String payload -> encoding = ""
Binary payload -> encoding = ""
JSON payload -> encoding = "json"
Cipher JSON payload -> encoding = "json/utf-8/cipher+aes-128-cbc"

Improve code example syntax

Instead of

bc[lang]. # first line must be here
# second line

Line break above causes code block to end

We should be able to use

```lang
 # first line

 # line break above is allowed
```.

Client library developer docs

Terminology clean up

Whilst working through the documentation today, I found that referring to clients that have a clientId as authenticated clients could be very confusing for users. This is probably because being authenticated has no relation to your authentication with Ably via a token or API key, and the word authentication exists in Basic Authentication as well.

Having had a quick chat about this, @paddybyers and I came up with the following suggestion, which should not have any impact on the client libraries fortunately, but will simply be rolled out in our documentation.

@SimonWoolf and @lmars, do you have any objections or suggestions to improve this terminology?

Authentication

The process of providing credentials to Ably in the form of a token or API key, which in turn allows you to communicate with Ably if the credentials are valid.

Authorisation

Ably is responsible for authorising or refusing operations for the authenticated client based on the permissions specified within the API key and/or Token provided when the client authenticated.

Identified Client

Any client that has connected to Ably and has either explicitly provided a clientId when instancing the library, or implicitly been assigned a clientId following token authentication, will then assume and be restricted to that clientId for all operations. As our customers are responsible for issuing tokens or token requests themselves, and we recommend that they only use token authentication and never share their private keys with clients, an identified client publishing or present on a channel with the clientId given in their token can therefore be trusted by other clients.

Update REST API docs

There are other features of the rest API that I think are also not in the docs, eg
?fields= (see Using-the-Admin-API#fields)
?select= (see Using-the-Admin-API#select)
?flatten= (see Using-the-Admin-API#flatten)

In getting the java library to run on Android I've run into the issue that the base HTTP primitive (HttpURLConnection) doesn't give you access to the response body in the case that:

  1. the statusCode is 401 or 407; and
  2. there is a request body (usually POST).

The reason is that under these circumstances the request body upload is forcibly terminated by closing the connection, and that in turn means that the response body is not read.

Response headers are available (and really do have to be, because otherwise WWW-Authenticate challenges would not work) so I've added the following headers to all error responses:

X-Ably-ErrorCode
X-Ably-ErrorMessage

These (with the statusCode) mean that a full error object can be constructed even if the response body is lost. (These are present for all error responses irrespective of method, where the error comes from the realtime system; but obviously not for errors arising downstream such as the loadbalancer.)

Document ability to change the defaults and lower the defaults

  • Retry immediately if a connection disconnects from a connected state
  • Retry every 15s whilst in the disconnected state
  • Moves to suspended state within 2 minutes
  • Retry every 30s whilst in the suspended state
  • Review the fallback strategy when connection fails because of network or server issues
  • Allow defaults to be reconfigured before instancing the library, with a defaults option.
  • Add REST request timeout

Include architecture overview for each client library

In the overview section for each client library, we should provide an architecture overview so that developers understand the principles behind the design of the library. For example, in Java it is threaded, in Ruby it relies on EventMachine, and Go uses Mutexes, Go routines & Channels. This overview should be replicated in the client library READMEs as well.

Spec behaviour messages published before a resumed connection

@paddybyers please see ably/ably-ruby@23877d5#diff-5a92463d6ab8ad3fc8cf8aff5cfde6f8R573

I have implemented a new feature in the Ruby library following a discussion with Peter a few days ago as follows:

  • Connection is opened
  • Message is published over the transport
  • The transport is disconnected
  • The connection is resumed with a new transport
  • The message ACK has not yet been received because the transport was disconnected beforehand, so the client library resends the message and gets an ACK

I would like your view on whether this is the correct behaviour. The alternative is to fail the message that was sent, but that does not feel right given it was actually sent successfully.

Change {{API_KEY_ID}} to {{API_KEY_NAME}}

Better to use the naming convention of {{KEY_NAME}} and {{KEY_SECRET}} for the two parts either side of the : of API keys. This will need to be updated on the website once rolled out.

Update client library spec sheets

Once #64 is finalise, update the spec spreadsheets with the recent batch of refinements to the spec. Also need confirmation on when ConnectionDetails wildcard is supported.

Review realtime features

@paddybyers and @kouno finally completed the spec for both realtime & REST, see http://docs.ably.io/client-lib-development-guide/features/

Please can you review and fixup any issues you foresee or add your comments here and I will amend. If you notice anything missing please add too.

I will be using this as a check list for all client library developers to confirm what amount of functionality exists and is tested in each client library, so it's important we get this right as it will into a Google Doc with a list to code to prove the feature is implemented.

Spec for queued messages following a reconnect

Scenario as follows:

  1. Client connects
  2. Client attaches to channel bacon
  3. Client publishes 5 messages to bacon
  4. Transport disconnects, and client automatically tries to reconnect
  5. Whilst reconnecting the developer publishes 5 more messages to the bacon channel, and another client publishes 3 messages to the bacon channel.
  6. Client reconnects, but is unable to resume, so detaches all channels

Question:

  • Should the queued messages for the channel that is not attached fail those messages as the channel is now failed?
  • Could we publish the messages anyway when we introduce the functionality to publish without being attached?

@paddybyers WDYT?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.