Skip to content

FINERACT-2485: Align legacy idempotency key storage width - #6566

Open
mcc0nnell wants to merge 4 commits into
apache:developfrom
mcc0nnell:fix/idempotency-key-storage-width
Open

mcc0nnell wants to merge 4 commits into
apache:developfrom
mcc0nnell:fix/idempotency-key-storage-width

Conversation

@mcc0nnell

Copy link
Copy Markdown

Core Fineract currently accepts the configured idempotency header without applying a length constraint before command processing. The legacy m_portfolio_command_source.idempotency_key column and its JPA mapping are limited to 50 characters, while the newer JDBC command store uses VARCHAR(255).

This change keeps the two command-storage paths consistent by:

  • widening m_portfolio_command_source.idempotency_key from 50 to 255 characters via a new Liquibase migration
  • updating the CommandSource JPA mapping to match
  • leaving existing idempotency behavior and keys unchanged

This is intentionally separate from #6231, which is hardening idempotency semantics for the newer command-processing path. This patch only removes a storage-width inconsistency in the legacy path.

@IOhacker

IOhacker commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@mcc0nnell please resolve the conflict

@mcc0nnell
mcc0nnell force-pushed the fix/idempotency-key-storage-width branch from cf26b37 to df563d9 Compare October 5, 2026 12:40
@mcc0nnell

mcc0nnell commented Oct 5, 2026 •

Copy link
Copy Markdown
Author

@IOhacker Conflict is resolved on the current signed head df563d9, and GitHub now reports the PR as mergeable. The resolution preserves upstream migrations 0254/0255 and renumbers this PR's idempotency-key migration to 0256; the JPA mapping remains length = 255. The new Fineract CI, PR Compliance, and Signed Commits Check runs are all blocked at GitHub's fork-workflow action_required approval gate with no jobs started. Could you please approve and run the workflows?

@mcc0nnell mcc0nnell changed the title Align legacy idempotency key storage width FINERACT-2485: Align legacy idempotency key storage width Oct 5, 2026
@adamsaghy

Copy link
Copy Markdown
Contributor

@mcc0nnell Please make sure your commits are GPG signed.

@adamsaghy

Copy link
Copy Markdown
Contributor

@mcc0nnell Please rebase onto the latest develop and resolve the conflicts.

@galovics galovics left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mcc0nnell, thanks for the PR. Widening the column and the @Column(length) together is the right shape.

  • On MySQL modifyDataType renders as a plain MODIFY COLUMN ... VARCHAR(255), which drops NOT NULL and defaults that are not restated. Is m_portfolio_command_source.idempotency_key NOT NULL (see 0061, which restates it for MySQL)? If yes, a context="mysql" changeset with MODIFY ... NOT NULL like 0061 keeps it. Can you verify on both DBs?
  • The column is also part of a unique constraint / composite index. Does that still fit MySQL's index key length limit at 255 chars?
  • We still don't validate the header length anywhere, so a 300-char key fails at the DB layer with a 500. Is a 400 at the handler level on your list?
  • Pls make sure the commits are signed and CI is green once a maintainer approves the workflows.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants