Skip to content

Fix events system upgrade#1348

Merged
khyatimahendru merged 3 commits into
faucetsdn:masterfrom
khyatimahendru:fix-events-system-upgrade
Jun 4, 2026
Merged

Fix events system upgrade#1348
khyatimahendru merged 3 commits into
faucetsdn:masterfrom
khyatimahendru:fix-events-system-upgrade

Conversation

@khyatimahendru
Copy link
Copy Markdown
Collaborator

The Problem

  1. Schema Evolution: In older UDMI schemas (like 1.4.1 used by the EasyIO devices), network connection events were logged using the system.network.* category prefix (e.g., system.network.disconnect and system.network.connect). In version 1.5.0, the schema was updated, and this category namespace was migrated to localnet.network.*.
  2. Validator Workflow: When the UDMI Validator receives a payload from a device claiming an older version (e.g. 1.4.1), it automatically tries to upgrade the message in memory to the latest standard before validating it against the newest schemas.
  3. The Missing Logic: The MessageUpgrader component contained logic for upgrading state messages, but it completely lacked any upgrade logic for events_system messages.
  4. The Failure: As a result, when the events_system messages were checked against the 1.5.0 schema, the categories were still prefixed with system.network.*. The 1.5.0 schema validator correctly rejected them as unrecognized categories since it was strictly expecting localnet.network.*.

The Solution

  1. Upgrading events_system Categories: Added a new method upgradeTo_1_5_0_events_system() to the MessageUpgrader class. This method intercepts events_system messages as they are being upgraded to 1.5.0.
  2. Category Replacement: The code safely iterates over the logentries array inside the payload payload. For each log entry, if the category string begins with system.network, it replaces the prefix with localnet.network (e.g. translating system.network.connect to localnet.network.connect).
  3. Testing: Added a unit test (eventsSystemUpgrade) in MessageUpgraderTest.java to ensure this substitution behaves correctly and doesn't affect other valid categories like system.auth.login.

@khyatimahendru khyatimahendru merged commit d498597 into faucetsdn:master Jun 4, 2026
53 of 72 checks passed
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