The messages are now got based on the id of the last known message
instead of on an offset (the number of known messages) to adjust to the
changes in the chat endpoint.
The chat endpoint was modified too to, based on the value of the
"lookIntoFuture" parameter, either immediately return the history of
messages or wait for new messages to be received; in this later case,
however, the old behaviour was preserved, so it can still be used to get
the existing messages too besides the new ones.
The only difference with the old behaviour is that now the number of
received messages is limited by the "limit" parameter (100 by default).
However, when "lookIntoFuture" is enabled and there are existing
messages it returns immediately, so even if there is a long history it
will load chunks of 100 messages until all the existing messages are
received (which also makes the browser more responsive than loading
thousands of messages at once).
Note that when "lookIntoFuture" is enabled the chat endpoint provides
the messages sorted from oldest to newest, so it is no longer needed to
explicitly sort the models in the collection.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The offset now is based on the last known chat message instead of limit-offset,
so new messages don't mess up requests to get the history of a room
Signed-off-by: Joas Schilling <coding@schilljs.com>
The acceptance tests requires the grandparent directory of the root
directory of the app to be the root directory of the Nextcloud server.
Drone only clones the app repository, so the Nextcloud server repository
has to be explicitly cloned and the app moved to the "apps" directory
before the tests are run.
Besides that, as the acceptance tests need to be run on Apache,
"/var/www/html" has to be linked to the root directory of the Nextcloud
server.
Once all that is done the tests can be run in the same way that they are
run in Drone for the Nextcloud server but just specifying the acceptance
tests directory too.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The Talk app requires a multi-threaded web server (due to its use of
long polling), so the configuration of the acceptance tests is changed
to use the Apache web server instead of the default PHP built-in web
server.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commits adds the base configuration needed to run acceptance tests
for the Talk app.
The script to run the acceptance tests simply calls the "run.sh" script
from the server acceptance tests specifying the directory of the
acceptance tests for the Talk app.
The installation script called before the acceptance tests are actually
run is extended from the one used in the acceptance tests for the server
to also enable the Talk app.
Due to Behat limitations, the Behat configuration used in the acceptance
tests for the server can not be extended; the configuration used is
exclusive for the Talk app. Due to that some parameters must be
duplicated from the Behat configuration for the server acceptance tests
(like the session definitions).
In any case, the core library and all the contexts for the server are
automatically available in the acceptance tests for apps; their path
does not need to be set in the "autoload" section, although the specific
contexts to be used have to be explicitly set; the ones included are
those needed (either directly or due to dependencies) to be able to use
the "I am logged in"/"I am logged in as the admin" steps, which are the
most basic steps needed by the acceptance tests for almost every app.
On the other hand, the paths to the features and the contexts from the
Talk app must be explicitly set in the configuration.
Finally, note that this commit does not include any test feature, so
calling "run.sh" would just end in a failure; some basic test features
will be added in a following commit.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>