Skip to content

[19.0][MIG] currency_rate_update_wise - #232

Open
klodr wants to merge 2 commits into
OCA:19.0from
klodr:19.0-mig-currency_rate_update_wise
Open

[19.0][MIG] currency_rate_update_wise#232
klodr wants to merge 2 commits into
OCA:19.0from
klodr:19.0-mig-currency_rate_update_wise

Conversation

@klodr

@klodr klodr commented Jun 20, 2026

Copy link
Copy Markdown

currency_rate_update_wise → 19.0

Forward-port of the Wise.com exchange-rate provider from 14.0 to 19.0.
Framework migration only, no functional change.

Notes for reviewers

  • Hermetic tests: the Wise HTTP layer (_wise_provider_retrieve) is mocked —
    no network access needed in CI.
  • Carries a small, non-blocking helper that logs a warning when the configured
    API token still uses the legacy UUID format (Wise UUID → JWT migration).

@OCA-git-bot OCA-git-bot added mod:currency_rate_update_wise Module currency_rate_update_wise series:19.0 labels Jun 20, 2026
@klodr
klodr force-pushed the 19.0-mig-currency_rate_update_wise branch 2 times, most recently from fc60c88 to 8b3aae1 Compare June 20, 2026 18:56
Forward-port of the Wise exchange-rate provider to 19.0 (the module is not
maintained upstream beyond 14.0). Framework migration only, no functional
change vs. the 18.0 module.

Signed-off-by: Claude Perrin <klodr@users.noreply.github.com>
@klodr
klodr force-pushed the 19.0-mig-currency_rate_update_wise branch from 8b3aae1 to ae4998d Compare June 20, 2026 19:20
Wise answers HTTP 400 when the "from" and "to" query parameters are equal:

  GET /v1/rates?source=USD&target=EUR&from=2026-08-04&to=2026-08-04&group=day
  -> 400 Bad Request

That is exactly the shape of a scheduled run once the rates are up to
date: the provider then asks for the single missing day. The failure is
therefore intermittent — it only shows up when no more than one day is
missing, which is the steady state of a daily cron.

Widen the window by one day when it would collapse. The endpoint only
returns the days it actually has, so no spurious rate is created; asking
for a "to" one day ahead of today answers 200 with today's rate only.

The existing tests mock the HTTP layer and never inspect the outgoing
query, which is why this went unnoticed. Add a test that captures the
parameters and asserts the window is never zero-length.

Signed-off-by: Claude Perrin <klodr@users.noreply.github.com>
(cherry picked from commit bac73b5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:currency_rate_update_wise Module currency_rate_update_wise series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants