You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "Bingtagui404 (via GitHub)" <gi...@apache.org> on 2026/03/19 08:06:25 UTC

[PR] [AMORO-4135][amoro-web] Fix blank duration column for sub-second optimizing durations [amoro]

Bingtagui404 opened a new pull request, #4136:
URL: https://github.com/apache/amoro/pull/4136

   ## Problem
   
   When the backend returns an optimizing duration between `1ms` and `999ms`, the duration column in the Optimizing table page is **blank**.
   
   This happens because `formatMS2Time()` in `amoro-web/src/utils/index.ts` only appends time units whose value is greater than 0. For values smaller than `1000ms`, all units (days/hours/minutes/seconds) are `0` after `Math.floor`, so the formatted result is an empty string.
   
   fix #4135
   
   ## Fix Scope
   
   Single file: `amoro-web/src/utils/index.ts`
   
   Added a check after the formatting loop: if the result string is empty but `ms > 0`, return `<1s` instead of an empty string.
   
   ```typescript
   if (!result && ms > 0) {
     return '<1s'
   }
   ```
   
   ## Verification
   
   Tested with `npm run dev:mock` — added a mock record with `duration: 500` and confirmed the duration column displays `<1s`.
   
   **Before (duration: 500ms):** blank cell
   **After (duration: 500ms):** `<1s`
   
   <!-- Paste screenshot below -->
   
   ### Unit test results
   
   | Input (ms) | Expected | Actual | Result |
   |---|---|---|---|
   | 0 | `` | `` | ✅ |
   | 1 | `<1s` | `<1s` | ✅ |
   | 500 | `<1s` | `<1s` | ✅ |
   | 999 | `<1s` | `<1s` | ✅ |
   | 1000 | `1s` | `1s` | ✅ |
   | 1500 | `1s` | `1s` | ✅ |
   | 3000 | `3s` | `3s` | ✅ |
   | 60000 | `1min` | `1min` | ✅ |
   | 61000 | `1min 1s` | `1min 1s` | ✅ |
   | 1195501081 | `13d 20h` | `13d 20h` | ✅ |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AMORO-4135][amoro-web] Fix blank duration column for sub-second optimizing durations [amoro]

Posted by "czy006 (via GitHub)" <gi...@apache.org>.
czy006 merged PR #4136:
URL: https://github.com/apache/amoro/pull/4136


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AMORO-4135][amoro-web] Fix blank duration column for sub-second optimizing durations [amoro]

Posted by "Bingtagui404 (via GitHub)" <gi...@apache.org>.
Bingtagui404 commented on PR #4136:
URL: https://github.com/apache/amoro/pull/4136#issuecomment-4088480658

   <img width="1280" height="720" alt="amoro-fix-screenshot" src="https://github.com/user-attachments/assets/4d6ff126-e045-4e28-882a-39e400421b0e" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org