Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 197
    • Issues 197
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 11
    • Merge Requests 11
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Merge Requests
  • !436

Merged
Opened Sep 01, 2025 by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Add the ability to emit logging messages from a `DbTx` transaction

Fixes #499 (closed).

The fix required passing a few constraints around unfortunately, but now we can emit logging messages directly from a DbTx block, which means we don't have to split our transactions anymore in order to log things. For example, now we can do:

  runDBTx $ do
    corpus_node <- getNode l -- (Proxy :: Proxy HyperdataList)
    let corpus_id = fromMaybe (panicTrace "no parent_id") (_node_parent_id corpus_node)
    $(txLogLocM) DEBUG "[postAsyncJSON] Executing re-indexing..."
    _ <- reIndexWith env corpus_id l NgramsTerms (Set.fromList [MapTerm, CandidateTerm])
    $(txLogLocM) DEBUG "[postAsyncJSON] Re-indexing done."

Previously we were forced to run the first part of the transaction, emit the logs, run the second part, meaning that if we had a problem in the second part, the first part wouldn't rollback correctly.

A txLogLocM function has been added to log inside a DbTx monad, which has the same API as logLocM.

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/issue-499 origin/adinapoli/issue-499

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/dev
git merge --no-ff adinapoli/issue-499

Step 4. Push the result of the merge to GitLab

git push origin dev

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 3
  • Pipelines 1
  • Changes 36
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
1
Labels
Ready to merge
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext!436

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.