Skip to content

Fix Discovery Service Regression - System Driver Database - #241

Merged
nickgaray merged 1 commit into
opensensorhub:masterfrom
Botts-Innovative-Research:discovery-service-regression-fix-system-driver-database
Oct 6, 2026
Merged

nickgaray merged 1 commit into
opensensorhub:masterfrom
Botts-Innovative-Research:discovery-service-regression-fix-system-driver-database

Conversation

@philip-khaisman

@philip-khaisman philip-khaisman commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes a regression where if a user added a system driver database with historical data only (no link to a live driver) the discovery service wouldn't discover it. To fix it I reimplemented the logic as it was in the older working version of the discovery service. On every request to the discovery endpoint now, the code will look through the federated database and load up facts for every datastream in the db.

Testing

  • Start a node that has the discovery service running
  • Add a system driver database and point it to a db file that has discoverable data. Do not configure a system uid
  • Hit the discovery endpoint. Make sure to use a param that should return data. Like if i load a simulated gps dataset, put location as the param
  • Verify that the discovery request response contains the datastream
  • Stop the system driver database
  • Verify that the discovery request response does not contain the datastream
  • Verify the same the visualizations endpoint

Regression Testing

  • Verify the discovery service still works as expected
  • Start a driver that streams live data
  • Hit the discovery endpoing
  • Verify that the request response contains the datastream
  • Same for the visualizations endpoint

* @param hub Handle to the instance of OpenSensorHub
* @return A list of facts generated from the node's federated database
*/
public List<DataStreamFact> getFederatedDbFacts(SensorHub hub) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rename to initializeFacts to have the same name as the same method in the discovery service

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I assume we're ok with duplicate methods between the discovery service and the rules engine since they are meant to work discretely, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I do not see an issue with it.

@nickgaray
nickgaray merged commit 2217b7f into opensensorhub:master Oct 6, 2026
1 check 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