Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Do Spar things transactionally

Open
#913 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
haskell
Domain
backend, databases

Research direction

Review the proposed insertScimAndSamlUser definition and the referenced pull request #905 first. Trace the existing Spar SCIM and SAML insertion path, including the batch and retry behavior shown in the issue. Done means the two inserts are handled transactionally as described and the WrappedScimStoredUser SparTag serialization concern is resolved.

Written by the indexing model from the issue text.

Description

Right, I think this might still be worth it in this one, and should look like something in the lines of:

insertScimAndSamlUser :: (HasCallStack, MonadClient m) => UserId -> SAML.UserRef -> ScimC.User.StoredUser SparTag -> m ()
insertScimAndSamlUser uid (SAML.UserRef tenant subject) scimUsr = retry x5 . batch $ do
  setType BatchLogged
  setConsistency Quorum
  addPrepQuery insScim (uid, WrappedScimStoredUser scimUsr)
  addPrepQuery insSaml (tenant, subject, uid)
  where
    insScim :: PrepQuery W (UserId, WrappedScimStoredUser SparTag) ()
    insScim = "INSERT INTO scim_user (id, json) VALUES (?, ?)"

    insSaml :: PrepQuery W (SAML.Issuer, SAML.NameID, UserId) ()
    insSaml = "INSERT INTO user (issuer, sso_id, uid) VALUES (?, ?, ?)"

The main annoyance I see with this is that you will need a Show instance for WrappedScimStoredUser SparTag -> not sure how trivial it is to come up with a meaningful one.

Originally posted by @tiago-loureiro in https://github.com/wireapp/wire-server/pull/905

Dominant language
Haskell
Stars
2.8k
Forks
332
Avg merge
3d 7h
Merged PRs (30d)
49

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wireapp/wire-server

All issues in wireapp/wire-server

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.