Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protection against loosing usage data when Spoolman is unavailable when committing usage #19

Open
mdziekon opened this issue Mar 20, 2024 · 2 comments
Labels
feature request Feature requests or ideas for improvements

Comments

@mdziekon
Copy link
Owner

Description

Since Spoolman is an external entity, there's an edge case, where an unavailable instance of Spoolman could cause loosing usage data. There are multiple ways to "fix" this:

  • Introduce retries on usage comitting
    • This fixes cases where Spoolman's instance is only temporarily unavailable (eg. short connectivity issue)
    • Should be easy to introduce
  • Store uncommited data in memory
    • This fixes cases where Spoolman's instance is unavailable for longer period of time
    • Requires retry triggering mechanism
      • Either autonomic timer
      • Or manual trigger button in the UI
    • UI should inform about uncommited data and take that into account when calculating "remaining weight"
    • UI not that easy to populate, required API call to retrieve memory data
    • Shutdown of Octoprint will cause loss of data, so not ideally fault tolerant
  • Store uncommited data in plugin's settings
    • Fixes the same case as solution above
    • Octoprint-issues tolerant (data persisted across Octoprint runs)
    • Requires retry triggering mechanism
      • Same as above
    • UI should inform about uncommited data and take that into account when calculating "remaining weight"
    • UI easier to populate, as Knockout's observers can be used in JS
    • Potential "settings have changed, restart Octoprint" modals
@mdziekon
Copy link
Owner Author

mdziekon commented Mar 21, 2024

Introduce retries on usage comitting

This basic mechanism has been implemented in #23

@mdziekon mdziekon changed the title Add protection against loosing usage data when Spoolman is unavailable when comitting usage Add protection against loosing usage data when Spoolman is unavailable when committing usage Mar 21, 2024
@mdziekon mdziekon added the feature request Feature requests or ideas for improvements label Sep 16, 2024
@mdziekon
Copy link
Owner Author

Related PR: #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature requests or ideas for improvements
Projects
None yet
Development

No branches or pull requests

1 participant