The export feature is not working correctly with
the newer version, so we are downgrading to 0.54.0.
We need to refactorize the code to be compatible
with typst in order to work correctly.
Duplicating a document tree made two calls to the collaboration server
per node, all inside the database transaction: it held locks for the
duration of every call, and a failure midway left the documents already
created on the collaboration server behind, as orphans nothing can
reach anymore.
The duplication now runs in two phases. The structure is first
replicated in a transaction that makes no call to the collaboration
server, then each duplicate is seeded with the content of its source.
A failure while seeding deletes what was seeded - the deletion of the
collaboration server is idempotent and never refused - and removes the
replicated documents, so neither side keeps an orphan.
Signed-off-by: Marrrrrrrrry <34876935+Marrrrrrrrry@users.noreply.github.com>
`backendFetch` had no timeout: a backend that hangs hangs every
websocket
upgrade and fallback poll with it, piling up under load. The three
auth-path
calls it serves (`users/me`, `documents/{id}`, `accesses/me`) waited
forever,
so a slow backend took the whole collaboration service down with it.
Signed-off-by: Marrrrrrrrry <34876935+Marrrrrrrrry@users.noreply.github.com>
The guide showed the impress realm and client, while keycloak.values.yaml
creates the docs realm and impress.values.yaml uses the docs client.
Copying the endpoints from the guide led to a 404.
Signed-off-by: Lewis Bertin <lewis@tactiqual.tech>
Since helm-dev-backend 0.0.13 (silo image) the server always listens
on 9000. The example still set api.port to 80, so the service pointed
to a closed port, the bucket job waited forever and helm install timed
out. Dropping it keeps the chart default, which impress.values.yaml
and the dev values already expect.
Signed-off-by: Lewis Bertin <lewis@tactiqual.tech>
Users mentioning themselves got an email about something they just
did, which is noise. Keep recording the mention, skip the email.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
The cache key claimed before sending outlived a failed notification,
so the next mention in the same context was silently dropped until the
key expired although nobody had been notified. Delete it unless the
email went out and `notified_at` was saved.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
Gate the ability to mention to users with explicit
access so only collaborators can mention collaborators.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
A reader cannot see comments, so a mention would lead them nowhere.
Reject readers as mention targets. while users allowed to comment
see each other so they can pick who to mention.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
Use cache.add as a distributed lock keyed by document/user/thread to
ensure only the first concurrent mention sends the notification
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
Add a dedicated "mention" throttle scope limiting calls
to the document mention endpoint to 30 requests per minute.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
Move the mention email off the request/response cycle into a Celery task
so the SMTP round-trip no longer delays the API response.
Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
Allow users with at least the commenter role on a document to mention
other collaborators in the document body or in a comment thread via
POST /documents/{id}/mention/. The mentioned user must already have
access to the document.
The mention record is always created, and the mentioned user is
notified by email with a link to the anchor, unless a notification
was already sent in the same context (document body or specific
thread) within a configurable cooldown period (15 minutes by default).
Signed-off-by: Mohamed El Amine BOUKERFA <boukerfa.ma@gmail.com>
Return all accesses on the document and its ancestors to any
user with access, keeping the limited user details serializer
and adding the user id to it, so that collaborators allowed
to comment can identify and mention each other.
Signed-off-by: Mohamed El Amine BOUKERFA <boukerfa.ma@gmail.com>
We can now paste docs url that will become interlinking.
So we don't want to pass titles through the inline content itself
anymore, to not leak any titles. The problem is that inline content
Inline content mappers are not async, so titles must be
resolved upfront.
We adapted the export interlinking to get titles from
a pre-resolved map instead of relying on inline content.
Pasting a bare link to another doc on the same domain now inserts an
interlink instead of a plain hyperlink, so it benefits from the same
title-sync and navigation behaviour as links added through the `/` or
`@` menu. Pasting over a selection, inside a code block, or a link the
current user can't resolve will display the doc id instead.
We want to introduce a feature flag that allows
duplicating documents along with their children when
enabled. We will be able to control not only
frontend side but also backend behavior
regarding document with children duplication.
We want to have a fine grained control over the
Duplicate with Children feature.
By adding the feature flag for Duplicate with Children,
we can enable or disable this feature for specific
users or groups without deploying new code.
This allows us to test the feature in a controlled
environment and gather feedback before a full rollout.
The quay.io/minio/minio and quay.io/minio/mc images now answer 401, and
the minio images are gone from Docker Hub as well: the dev stack, the
backend CI job and the helm dev-backend could not pull them anymore.
[pgsty/silo](https://hub.docker.com/r/pgsty/silo) and
[pgsty/mc](https://hub.docker.com/r/pgsty/mc) are community builds and drop
in replacement of minio. Only the executable name is changing from minio
to silo.
Search results were cmdk items navigating with router.push on select,
so the browser had no link to open elsewhere. Each result is now a real
link to the document: a plain click still goes through the quick search
onSelect, while ctrl, cmd, shift or middle click let the browser open it
in a new tab or window and keep the search modal open.
Signed-off-by: Armand <schneideretcollier.innovation@gmail.com>
After implementing the websocket and api stress tests, this last step is
using playwright to simulate a real user using docs. A real chromium
will be used for this. The idea is to see what a user feels when Docs is
under load.
When metrics is enabled, we want to create a ServiceMonitor od
PodMonitor in order to scrap the metrics from django and yhub. We have
to add an exception on the redirect to ssl for the metrics endpoint,
like for the probes endpoint, the traffic is internal.
To stress test the backend application we will use the k6 project from
grafana. 2 scenarios are implemented and documented in the README. How
to use this project is also documented in the README
standlone package simulating traffic on the yhub server. It reuses the
same stack used bu the frontend application to connect to the websocket.
How to use it is explained in its README file.
We added custom metrics when the monitoring is enabled, we will measure
the cost of calling outside services like yhub and the converters, the
database pool and celery queue.
We don't want to manage a valkey operator and cluster inside the Docs
repo, this will be managed outside. For dev purpose we only need a
standalone instance of valkey.
To test the application on real condition we want to authenticate users.
The authentication is made using OIDC and we don't want to depend on
this during the tests. To bypass it, we will create real user sessions,
export thei identifiers and then use it later with the tool firing the
requests. The session are linked to real users, everything is made in a
dedicated django application and this application is explicitely loaded
in a dedicated environment and can't be used in the Production
environment.
Same we did before with django-prometheus, we want metrics for yhub, the
is no integration available like django-prometheus so everything is
craft in the repository. The documentation is also available in
documentation/metrics.md