Skip to content

api: when parsing @ud, also accept plain decimal#5342

Merged
latter-bolden merged 2 commits into
developfrom
m/eww-aura
Dec 5, 2025
Merged

api: when parsing @ud, also accept plain decimal#5342
latter-bolden merged 2 commits into
developfrom
m/eww-aura

Conversation

@Fang-
Copy link
Copy Markdown
Member

@Fang- Fang- commented Dec 4, 2025

Summary

#5134 naively assumed parseUd meant we wanted to parse @ud-formatted numbers. Turns out sometimes it means we want to parse plain decimal number strings!

Changes

Presumably, the parseUd() of the old aura-js silently accepted decimal number strings without dots, because the new parse('ud', myString) calls were (in some cases) (we assume) crashing, failing to parse their inputs.

Here, we add a helper that tries both and update all parse('ud', ..) calls to use that instead. This may be more lenient than it strictly needs to be, but we intentionally punt on unraveling that particularly messy tapestry. (See also time.md...)

How did I test?

Paired on the change concept with @latter-bolden. CI will sanity-check this specific implementation.

(Although, it didn't catch the problematic cases from #5134 either. We suspect this was specific to deletions. Do we not e2e test those?)

Risks and impact

  • Yes, safe to rollback without consulting PR author.
  • Affects important code area:
    • Message sync

Rollback plan

Revert.

Presumably, the `parseUd()` of the old aura-js silently accepted decimal
number strings without dots, because the new `parse('ud', myString)`
calls were (in some cases) (we assume) crashing, failing to parse their
inputs.

Here, we add a helper that tries both and update all `parse('ud', ..)`
calls to use that instead. This may be more lenient than it strictly
needs to be, but we intentionally punt on unraveling that particularly
messy tapestry. (See also `time.md`...)
// we used a too-lenient @ud parser, which also accepted dotless
// representations, making it slightly unclear/ambiguous what we were actually
// *intending* to parse. the backend is wildly inconsistent, so this is easier
// and safer than figuring all that out. (we'll tighten things up Soon™.)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

™️

@latter-bolden
Copy link
Copy Markdown
Member

Let's check why the tests are failing tomorrow morning

@latter-bolden latter-bolden merged commit 4683e2c into develop Dec 5, 2025
5 of 6 checks passed
@latter-bolden latter-bolden deleted the m/eww-aura branch December 5, 2025 17:31
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.

2 participants