- 12 May, 2025 1 commit
-
-
Alfredo Di Napoli authored
This gigantic commit ports the existing DB operations in GGTX to use the transactional API, meaning that we can now compose DB operations and they will all run in the same Postgres transaction using the same connection, which will eliminate those class of bugs where concurrent DB access might result in an inconsistent state. On top of that, we simplify some parts of the API, for which a summary is given below: 1. The `NodeStoryEnv` management has been greatly simplified; in the new API we don't need an external connection pool to be passed and we don't have to pass IO actions, we can just pass DB operations, therefore we can greatly simplify the API to just pass mostly pure values; 2. Due to the fact that our `DBTx` monad can't do arbitrary IO (which is a good thing) we cannot fire Central Exchange notifications immediately. Rather that happens now is that we collect the `CEMessage` to be sent and we fire them in the relevant concrete monad after we finished with the DB transaction. This means that in principle there would be a small delay between the DB operation taking place and the notification firing but in practice the latency should be negligible and bear in mind this is typically what we want: if we have a long DB Tx that triggers an error in the middle we don't want to be sending out CE messages prematurely if the overall operation didn't succeed! 3. There are still a few places in the codebase where we couldn't make things fully compositional with regards to the DBTx API, because we had Servant handlers which had DB operations mixed with other IO effectful computations (or other things like the notification from the `MonadJobStatus`). For now we are splitting these functions by manually running the partial DB operations, and while this is not ideal it can be fixed in subsequent merge requests. 4. The `WorkerEnv` doesn't use `IOException` as its `MonadError` anymore, as for consistency we can just use `BackendInternalError` by adding a `InternalWorkerError` data constructor accepting the `IOException` triggered by the Worker monad. More testing is needed, with particular attention to performance (regression) but this should hopefully offer a decent baseline.
-
- 24 Apr, 2025 1 commit
-
-
Alfredo Di Napoli authored
-
- 18 Dec, 2024 1 commit
-
-
Przemyslaw Kaminski authored
-
- 18 Nov, 2024 2 commits
-
-
Alfredo Di Napoli authored
Previously there was no symmetry in the name of the share endpoint, which is meant to be used to generate a publicly-accessible URL to view a node, and the previously-called "unpulish" endpoint. The problem is that now the "unpublish" name would clash with the dual of publishing a node. To avoid the problem, this commit renames the old "unpublish" endpoint to be "unshare", so that now it's clear that is the inverse operation of "share".
-
Alfredo Di Napoli authored
This allows the frontend to correctly display a different icon in case a node has been published with edits enabled or not.
-
- 14 Nov, 2024 1 commit
-
-
Przemyslaw Kaminski authored
-
- 11 Nov, 2024 11 commits
-
-
Alfredo Di Napoli authored
This commit splits the policy checks we do on node operations into "read" checks and "write" checks, so that we can enforce different kind of policies based on the state of a node (i.e. published or not).
-
Alfredo Di Napoli authored
This commit refactors the `NodeNodeCategory` so that we create a better hierarchy to account for node publication, including all the policies it might have.
-
Alfredo Di Napoli authored
It also: * Removes UserNodePublic from typesWhiteList in isNodeReadOnly
-
Alfredo Di Napoli authored
This commit refactors a bit the internal of the `Gargantext.Database.Query.Tree` module so that it removes a lot of repetitive boilerplate and paves the way to more interesting features. It also: * Adds the `isUserNode` boolean query * Adjust source and target in publishNode and unpublishNode * Pass the currently-logged-in user to tree API functions
-
Alfredo Di Napoli authored
It also: * Amends tests for policy checks status code changes * Fix a bug in isNodeReadOnly * Adds a function to return all the nodes ids for the published nodes. Next we need to modify `findShared` & co to make sure that published notes will show somewhere in the users' tree.
-
Alfredo Di Napoli authored
Now this query accounts correctly for recursive children. It also: * Adds basic publish/unpublish works * Add Move API tests scaffolding
-
Alfredo Di Napoli authored
Now a `NodeNodePoly` stores a typed `NodeNodeCategory`, we can use to enforce invariants and making lookups more efficient.
-
Alfredo Di Napoli authored
This commit makes this function private to the `Table.NodeNode` module as it's fairly low-level, and it doesn't let us embed logic to ensure we are creating a valid node2node relationship. Better use one of the other specialised functions.
-
Alfredo Di Napoli authored
This commit removes the `InsertDB` typeclass, an indirection which wasn't very useful as it was being used in exactly one place in the whole codebase (i.e. the share code). Talking about share, this commit refactors things ever so slightly so that we have a dedicated `shareNode` operation rather than using the low-level `insertNodeNode`.
-
Alfredo Di Napoli authored
-
Alfredo Di Napoli authored
This commit splits the old `NodeAPIEndpoint` type into three; * `NodeAPIEndpoint`, which will also contain the freeze endpoint; * `AnnuaireAPIEndpoint`, which is the plain old node API without extra features; * `CorpusAPIEndpoint`, which will also contain the publishin endpoint. This split ensures that we don't add endpoints which do not belong to all three categories, like before. Furthermore this adds a public nodes SQL queries. It also adds tests for getUserRootPublicNode
-
- 09 Sep, 2024 1 commit
-
-
Grégoire Locqueville authored
- Re-enable orphan warnings that were manually disabled in many modules - Remove non-Haskell files that were just sitting in the source tree - Remove modules that were not called from anywhere - Remove unused dependencies This is not exhaustive by any means. In particular, some more weeding out can be achieved by looking at individual functions and even branches of functions. Weeder can help with that.
-
- 09 Apr, 2024 1 commit
-
-
Przemyslaw Kaminski authored
-
- 25 Mar, 2024 1 commit
-
-
Przemyslaw Kaminski authored
-
- 21 Mar, 2024 1 commit
-
-
Przemyslaw Kaminski authored
This contains only data, removes some Database dependency in imports.
-
- 12 Oct, 2023 1 commit
-
-
Przemyslaw Kaminski authored
Basically, Gargantext.Prelude exports all of Protolude now.
-
- 11 Oct, 2023 1 commit
-
-
Przemyslaw Kaminski authored
-
- 10 Oct, 2023 1 commit
-
-
Przemyslaw Kaminski authored
- DBCmd instead of Cmd - remove FlowCmdM in favor of HasNodeStory
-
- 09 Feb, 2023 1 commit
-
-
Przemyslaw Kaminski authored
Remove joins, use optionalRestrict instead. Also, remove cabal.project because stack.yaml and package.yaml cover dependencies already.
-
- 01 Jun, 2022 1 commit
-
-
Alexandre Delanoë authored
-
- 20 Jan, 2022 3 commits
-
-
Alexandre Delanoë authored
-
Alexandre Delanoë authored
-
Alexandre Delanoë authored
-
- 04 Jan, 2022 1 commit
-
-
Alexandre Delanoë authored
-
- 29 Sep, 2021 1 commit
-
-
Alexandre Delanoë authored
-
- 09 Mar, 2021 1 commit
-
-
Przemyslaw Kaminski authored
-
- 16 Feb, 2021 1 commit
-
-
Przemyslaw Kaminski authored
-
- 23 Dec, 2020 1 commit
-
-
Alexandre Delanoë authored
-
- 22 Dec, 2020 1 commit
-
-
Alexandre Delanoë authored
-
- 18 Sep, 2020 1 commit
-
-
Alexandre Delanoë authored
-
- 31 Aug, 2020 1 commit
-
-
Alexandre Delanoë authored
-
- 25 Jul, 2020 1 commit
-
-
Alexandre Delanoë authored
-
- 22 Jul, 2020 2 commits
-
-
Alexandre Delanoë authored
-
Alexandre Delanoë authored
-