Skip to content

Implement listPrimaryUsersByEmail_Transaction / listPrimaryUsersByPhoneNumber_Transaction (single-connection reads) #413

Description

@tamassoltesz

Part of PLAN-018, Unit 3. Full design: agent-plans PLAN-018.

Cross-repo dependency (wired by append-cross-deps.sh): requires the
plugin-interface contract from PLAN-018
(listPrimaryUsersByEmail_Transaction /
listPrimaryUsersByPhoneNumber_Transaction on AuthRecipeSQLStorage).
Build against that pi base branch (same branch name -> CI auto-pairs).

What to implement. In Start.java / the auth-recipe queries, implement
the two new _Transaction reads as the SAME SQL as the existing
listPrimaryUsersByEmail / listPrimaryUsersByPhoneNumber, executed on
the passed transaction connection (QueryExecutorTemplate.execute(con, …))
instead of borrowing a fresh pooled connection. Reuse the existing query
strings; only the connection source changes. These are plain reads — no
FOR UPDATE.

Acceptance.

  • Both _Transaction reads implemented in postgres; behaviour identical to
    the non-tx forms except they run on the caller's connection.
  • NO schema change, NO new index, NO migration script, NO manifest.json
    entry — verify the CI migration/changelog gate passes by absence of a
    migration.
  • CHANGELOG line under the topmost unreleased section:
    Add transaction-aware listPrimaryUsersByEmail/ByPhoneNumber reads.
  • No version bump in the PR.

Out of scope / policy: do NOT touch supertokens-mysql-plugin. The
in-memory (sqlite) impl of these two methods travels with the core Unit-3
ticket (core repo), not here.

Note — the pg FK helper is NOT in scope of this plan. The postgres
Start.isForeignKeyConstraintError classifies from the ServerErrorMessage
(SQLState 23503 + constraint name) and opens no connection, so it is not a
nested-acquisition site — leave it alone (Unit 2 is core-in-memory only).

Plan: PLAN-018

Depends-on: supertokens/supertokens-plugin-interface#227

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-wipClaimed by an agent worker session

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions