Skip to content

Update DataProvider backend and API to v2.0.0#5

Merged
remdui merged 17 commits intomainfrom
2.0
Mar 29, 2026
Merged

Update DataProvider backend and API to v2.0.0#5
remdui merged 17 commits intomainfrom
2.0

Conversation

@remdui
Copy link
Copy Markdown
Member

@remdui remdui commented Mar 29, 2026

Summary

This PR introduces DataProvider v2.0.0 and delivers a major lifecycle, security, and platform-architecture upgrade.

Key Changes

  • Added optional scoped lifecycle APIs for advanced ownership isolation:
  • Refactored core ownership/lifecycle internals with typed identifiers (PluginId, OwnerScopeId, ConnectionIdentifier) and stronger reference tracking/cleanup.
  • Hardened runtime lifecycle behavior:
    • post-shutdown API use now fails fast
    • clean re-enable/restart handling via shared PlatformDataProviderRuntime
    • Unified Bukkit and Velocity command behavior through DataProviderCommandService.
  • Expanded admin commands:
    • /dataprovider help
    • /dataprovider status [summary|connections] [unhealthy] [plugin <name>] [type <databaseType>]
    • /dataprovider config
    • /dataprovider reload
  • Replaced platform-specific logger interface with backend-agnostic logging.
  • Refactored public provider contract into read-only handles.
  • DatabaseProvider no longer exposes lifecycle methods
  • Lifecycle now managed internally through ManagedDatabaseProvider
  • Hardened and tuned all backend implementations (MySQL, MongoDB, Redis, Redis Messaging):
    • stricter config validation and bounds checks
    • stronger TLS enforcement
    • safer async execution via AsyncTaskSupport
    • improved pooling/queue controls and operational limits
  • Added best-effort file permission hardening for config files/directories.
  • Updated docs and examples, including a new scoped lifecycle guide: docs/SCOPED_LIFECYCLE.md.

Breaking Changes / Migration Notes

  1. DatabaseProvider.connect() and DatabaseProvider.disconnect() are no longer part of the public API.
  2. API discovery is now platform-native:
  • Bukkit/Paper: resolve DataProviderAPI via ServicesManager.
  • Velocity: resolve via plugin instance implementing DataProviderApiSupplier.
  1. Insecure TLS config combinations now fail startup instead of being tolerated.
  2. DataProviderAPI should be treated as runtime-scoped; reacquire it after reload/re-enable.

Testing

  • Added new tests for scoped lifecycle API, async task support, caller resolution, shared command service, platform runtime lifecycle, and Velocity bootstrap/API supplier behavior.
  • Expanded existing tests for registry/handler lifecycle, backend behavior, and platform command adapters.

@remdui remdui merged commit f2c857a into main Mar 29, 2026
4 checks passed
@remdui remdui deleted the 2.0 branch March 29, 2026 17:48
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.

1 participant