Closed bigboydiamonds closed 2 months ago
The changes involve a comprehensive refactor of the maintenance state management system within the synapse-interface
package. Key updates include the introduction of new hooks for maintenance data retrieval (useMaintenanceData
), progress bars (useEventCountdownProgressBar
), and overall maintenance logic (useMaintenance
). Utility functions were added for fetching JSON data, validating bridge modules, and managing paused chains and modules. Additionally, Redux slices and hooks were implemented to centralize maintenance state management.
File(s) | Change Summary |
---|---|
Maintenance.tsx |
Refactored maintenance state management; renamed useMaintenanceCountdownProgressBar to useEventCountdownProgressBar ; introduced useMaintenanceData and useMaintenance . Updated logic for banners and warnings. Added BridgeModulePause interface and functions for validating and naming modules. |
functions/fetchJsonData.ts , getFurthestFutureDate.ts , getSynapsePauseData.ts , isValidBridgeModule.ts |
Added functions for fetching JSON data with retry logic, getting the furthest future date, retrieving synapse pause data, and validating bridge modules. |
BackgroundListenerProvider.tsx |
Imported and used useMaintenanceListener hook. |
slices/maintenance/hooks.ts , slices/maintenance/reducer.ts |
Introduced useMaintenanceState for accessing maintenance state from Redux store and added a Redux slice for managing maintenance state, including initial state and reducers for paused chains and modules. |
utils/getBridgeModuleNames.ts |
Introduced function for retrieving bridge module names based on input parameters. |
utils/hooks/useFetchGasDataOnInterval.ts |
Removed a console log statement from the useFetchGasDataOnInterval function. |
utils/hooks/useMaintenanceListener.ts |
Added useMaintenanceListener hook to trigger regular maintenance data fetches using useIntervalTimer . |
sequenceDiagram
participant MaintenanceComponent
participant useMaintenance
participant useMaintenanceData
participant fetchJsonData
participant ReduxStore
MaintenanceComponent->>useMaintenance: Call useMaintenance()
useMaintenance->>useMaintenanceData: Call useMaintenanceData()
useMaintenanceData->>fetchJsonData: Fetch data from URL
fetchJsonData-->>useMaintenanceData: Return JSON data
useMaintenanceData->>ReduxStore: Set paused chains/modules data
useMaintenance-->>MaintenanceComponent: Return maintenance state
MaintenanceComponent->>useMaintenance: Display banners and warnings
Amid the code so bright and clear,
Maintenance logic shifts, oh dear!
Hooks and slices, nicely tamed,
Bridge modules aptly named.
JSON fetches, retries strong,
Synapse pauses, can't go wrong.
CodeRabbit cheers with glee,
For changes made so brilliantly! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Latest commit: |
88b7a9a
|
Status: | β Deploy successful! |
Preview URL: | https://19133062.sanguine-fe.pages.dev |
Branch Preview URL: | https://fe-maintenance-read-method.sanguine-fe.pages.dev |
Latest commit: |
88b7a9a
|
Status: | β Deploy successful! |
Preview URL: | https://dcb890df.sanguine.pages.dev |
Branch Preview URL: | https://fe-maintenance-read-method.sanguine.pages.dev |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.48563%. Comparing base (
8e30911
) to head (88b7a9a
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Changes will increase total bundle size by 4.9MB :arrow_up:
Bundle name | Size | Change |
---|---|---|
sdk-router-@synapsecns/sdk-router-esm | 252.32kB | 0 bytes |
synapse-interface-server-cjs | 1.38MB | 1.09kB :arrow_up: |
synapse-interface-client-array-push | 7.45MB | 7.45MB :arrow_up: |
sdk-router-@synapsecns/sdk-router-cjs | 521.95kB | 404.94kB :arrow_up: |
synapse-interface-edge-server-array-push | 83 bytes | 0 bytes |
widget-esm-cjs | 275.25kB | 0 bytes |
widget-cjs-esm | 273.3kB | 273.3kB :arrow_up: |
explorer-ui-server-cjs | (removed) | 895.87kB :arrow_down: |
explorer-ui-edge-server-array-push | (removed) | 83 bytes :arrow_down: |
explorer-ui-client-array-push | (removed) | 2.34MB :arrow_down: |
Requires https://github.com/synapsecns/sanguine/pull/2859 to be merged in order to utilize github pages urls.
Summary by CodeRabbit
New Features
Refactor
Chores
03bf5f5e9cd63d017dcbad71cc5a449517d26a99: synapse-interface preview link a97fff09d6f209158b0871cf38e1f6e7958f1faa: synapse-interface preview link cf93a17494a77b07ac6739d2beeafb6d231d3ba3: synapse-interface preview link d1ee8e8548c0a709dc20c7598808c2c9aeb997c2: synapse-interface preview link 8b7f4bab2edae3698f14bd313c1827bb59a9fb4d: synapse-interface preview link 5225d9961fe6e79c15a9dad2e01d334b94358052: synapse-interface preview link efa74eb5432a28e447873ee201c54cbe55253142: synapse-interface preview link 91e37d703869e754301c4a64ae62a247da047a36: synapse-interface preview link 3f33dd0718c26342d1ef7cb2ece91e27a94334b8: synapse-interface preview link