Skip to content

Fix journal view to display updated application names after registration changes #4554

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

Merged
merged 8 commits into from
Aug 15, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 8, 2025

The journal view was displaying outdated application names even after applications updated their registration information with new names. This occurred because the journal only considered REGISTERED events when building the instance name mapping, completely ignoring REGISTRATION_UPDATED events that contain the updated application names.

Problem

When an application changes its name and sends a REGISTRATION_UPDATED event to Spring Boot Admin, the journal view continued to show the old name from the original REGISTERED event. This created confusion as:

  1. The journal displayed the old application name (e.g., "HIKU DCD EVEN")
  2. The application details showed the correct new name (e.g., "HIKU DCD MONITORING AGENT")
  3. External systems like Eureka showed the correct new name
  4. Only the journal view was stuck with the outdated name

Root Cause

The instanceNames computed property in /views/journal/index.vue only filtered for InstanceEvent.REGISTERED events:

.filter((event) => event.type === InstanceEvent.REGISTERED)

This meant that subsequent REGISTRATION_UPDATED events were ignored when building the instance name lookup map.

Solution

Updated the filter to include both registration event types:

.filter(
  (event) =>
    event.type === InstanceEvent.REGISTERED ||
    event.type === InstanceEvent.REGISTRATION_UPDATED,
)

Since events are processed in chronological order and later events overwrite earlier ones in the reduce operation, the most recent application name will always be used, whether from an initial registration or a subsequent update.

Testing

  • ✅ All existing tests continue to pass (272/272)
  • ✅ Added comprehensive test coverage for the fix
  • ✅ Frontend builds successfully without warnings
  • ✅ Code passes all linting and formatting checks

The fix is minimal and surgical, changing only the event filtering logic without affecting any other journal functionality.

Fixes #4476.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • artifactory-oss.prod.netflix.net
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/spring-boot-admin/spring-boot-admin org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests -q (dns block)
  • maven.repository.redhat.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/spring-boot-admin/spring-boot-admin org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests -q (dns block)
  • packages.confluent.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/spring-boot-admin/spring-boot-admin org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests -q (dns block)
  • repository.hazelcast.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.11/a2d47e15/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/spring-boot-admin/spring-boot-admin org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI self-assigned this Aug 8, 2025
Copy link
Contributor Author

Copilot AI commented Aug 8, 2025

@ulischulte 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@Copilot Copilot AI changed the title [WIP] Bug: The journal view displays the old application names Fix journal view to display updated application names after registration changes Aug 8, 2025
@Copilot Copilot AI requested a review from ulischulte August 8, 2025 13:43
Copilot finished work on behalf of ulischulte August 8, 2025 13:43
@ulischulte ulischulte marked this pull request as ready for review August 8, 2025 16:07
@ulischulte ulischulte requested a review from a team as a code owner August 8, 2025 16:07
@ulischulte ulischulte requested a review from Copilot August 8, 2025 21:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where the journal view displayed outdated application names after applications updated their registration information. The root cause was that the journal only considered REGISTERED events when building instance name mappings, ignoring REGISTRATION_UPDATED events that contain updated names.

  • Updated the event filter to include both REGISTERED and REGISTRATION_UPDATED events
  • Modified the reduce operation to process events chronologically so the most recent name is used
  • Added comprehensive test coverage for the fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
spring-boot-admin-server-ui/src/main/frontend/views/journal/index.vue Updated instanceNames computed property to filter for both registration event types and process them chronologically
spring-boot-admin-server-ui/src/main/frontend/views/journal/index.spec.ts Added new test file with comprehensive coverage for the registration update functionality

@ulischulte ulischulte self-requested a review August 8, 2025 21:48
});

const instanceNames =
container.firstChild.__vueParentComponent.ctx.instanceNames;
Copy link
Member

Choose a reason for hiding this comment

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

in other tests we do not use properties, but check what is visible on screen, right?

Copy link
Member

Choose a reason for hiding this comment

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

maybe @SteKoe should review this before merge

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. The tests now are using screen to check for the instance names.

@ulischulte ulischulte requested a review from erikpetzold August 11, 2025 09:03
@ulischulte ulischulte enabled auto-merge (squash) August 15, 2025 10:07
@ulischulte ulischulte disabled auto-merge August 15, 2025 10:07
@ulischulte ulischulte enabled auto-merge (squash) August 15, 2025 10:09
@ulischulte ulischulte merged commit 7c317a0 into master Aug 15, 2025
2 checks passed
@ulischulte ulischulte deleted the copilot/fix-4476 branch August 15, 2025 10:18
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.

Bug: The journal view displays the old application names
3 participants