Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE: Consumers: Fix lag is displayed as 'N/A' in case of null value #720

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

K-Diger
Copy link
Contributor

@K-Diger K-Diger commented Dec 20, 2024

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

Reasons for setting up Git incorrectly
#686
created a new PR with the same content as the PR above.

close #675

The default value of Consumer Lag displayed when searching the Consumer List has been modified.

The existing displayed value is 'N/A', which is different from the response value of '0' that the server responds to.

We believe that 'N/A' may mean a state of disuse, so we write it as 0 to make it clear.

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)

@K-Diger K-Diger requested a review from a team as a code owner December 20, 2024 05:05
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress area/consumers status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Dec 20, 2024
@Haarolean
Copy link
Member

  1. There's no need to spam with PRs, in favor of keeping the history. You can rebase or merge your PRs.
  2. I still have no faintest clue what you are trying to achieve here
    As I mentioned in your previous PR (FE: Fix Default Consumer's Lag Value #686 (comment)), 0 and N/A are two distinct values.
    The current implementation looks fine, we interpret both values separately. With your changes, replacing a logical or with a bullish coalesce operator, you'd mutate the 0 value into being displayed as 0 rather than N/A.
image

Please cover your changes with unit tests, thanks.

Copy link

kapybro bot commented Dec 20, 2024

Further user feedback is requested. Please reply within 7 days or we might close the issue.

@K-Diger
Copy link
Contributor Author

K-Diger commented Dec 20, 2024

  1. I still have no faintest clue what you are trying to achieve here

Before adding unit test code, I will first explain my position on your response.

The intention is to apply the results you tested in the console to the actual service.

When you test on the console, if 0 is assigned to the variable value,

When you run the existing code, you may have seen it displayed as 'N/A'.

However, in the code I modified, it be displayed as 0.

This is my intention with this example.

This is because 'N/A' has a different meaning from '0'.

To summarize again:
If the server responds with a Consumer Lag value of 0, it must be displayed as 0.

I only want to mark as N/A situations where Consumer Lag cannot be delivered due to an actual problem within the server, such as a Null on the server, or a problem within the Kafka ecosystem.

I think '0' and 'N/A' should be interpreted differently.

Copy link

kapybro bot commented Dec 20, 2024

Thanks for the additional feedback! We'll get back to your issue soon.

@kapybro kapybro bot unassigned K-Diger Dec 20, 2024
@K-Diger K-Diger force-pushed the k-diger/#675 branch 4 times, most recently from 69759af to 1ad8cb8 Compare December 22, 2024 11:35
@Haarolean Haarolean added scope/frontend Related to frontend changes type/bug Something isn't working and removed status/triage/manual Manual triage in progress labels Jan 6, 2025
@Haarolean Haarolean changed the title FE: Fix Default Consumer's Lag Value with nullish coalescing FE: Consumers: Fix lag is displayed as 'N/A' in case of null value Jan 6, 2025
@Haarolean Haarolean merged commit 91f95f6 into kafbat:main Jan 6, 2025
12 of 14 checks passed
@Haarolean
Copy link
Member

@K-Diger thanks for your first contribution to kafbat UI! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/consumers scope/frontend Related to frontend changes status/triage/completed Automatic triage completed type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FE: Consumers: Lag is displayed as 'N/A' in case of null value
2 participants