client: persist client map - #7371
Draft
thc202 wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds persistence for the Client Map by introducing database tables/entities for map nodes/components and wiring the ClientMap lifecycle to load/save map state with the session database.
Changes:
- Added JDO entities + DAO (
ClientMapNode,ClientMapComponent,ClientMapDao) and Flyway migration to store client map nodes/components. - Replaced
reportedObjectConsumerwith a broaderPersistenceConsumerinClientMap, and integrated it inExtensionClientIntegrationto persist map updates and reload on startup/session changes. - Added/updated unit tests to cover DAO conversions and new persistence consumer callbacks.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| addOns/client/src/test/java/org/zaproxy/addon/client/internal/db/ClientMapDaoUnitTest.java | New unit tests for DAO conversion and null-PMF behavior. |
| addOns/client/src/test/java/org/zaproxy/addon/client/internal/ClientMapUnitTest.java | Updated tests for the new PersistenceConsumer and publish-events toggling. |
| addOns/client/src/main/resources/META-INF/persistence.xml | Registers new persistence-capable classes. |
| addOns/client/src/main/resources/db/migration/V2__Create_map_tables.sql | Adds DB tables for persisted client map nodes/components. |
| addOns/client/src/main/java/org/zaproxy/addon/client/ui/ClientMapPanel.java | Adds attach/detach helpers to swap the tree model during bulk load. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/db/ClientMapNode.java | New persisted entity for map nodes. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/db/ClientMapDao.java | New DAO for persisting/loading/updating/deleting nodes/components. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/db/ClientMapComponent.java | New persisted entity for node components. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/ClientSideDetails.java | Makes setContentLoaded public for reload-from-DB. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/ClientSideComponent.java | Adds persistenceId and replaces Lombok all-args ctor with explicit ctor. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/ClientNode.java | Adds persistenceId to track DB identity per node. |
| addOns/client/src/main/java/org/zaproxy/addon/client/internal/ClientMap.java | Introduces PersistenceConsumer, persistence hooks, and a publish-events toggle. |
| addOns/client/src/main/java/org/zaproxy/addon/client/ExtensionClientIntegration.java | Hooks persistence into the extension lifecycle; loads map from DB; deletes DB entries on node deletion. |
| addOns/client/CHANGELOG.md | Notes the new persisted client map feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Great job! No new security vulnerabilities introduced in this pull requestUse @Checkmarx to interact with Checkmarx PR Assistant. |
thc202
force-pushed
the
client/map-persist
branch
2 times, most recently
from
June 1, 2026 19:12
92a600a to
072dea2
Compare
thc202
marked this pull request as ready for review
June 2, 2026 09:18
kingthorin
approved these changes
Jun 2, 2026
Persist the client map to the session. Signed-off-by: thc202 <thc202@gmail.com>
thc202
force-pushed
the
client/map-persist
branch
from
June 2, 2026 13:52
072dea2 to
be788f5
Compare
thc202
marked this pull request as draft
June 3, 2026 09:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Persist the client map to the session.