Skip to content

Semver2 fix 656#681

Merged
TheCommCraft merged 3 commits into
semver2from
semver2_fix_656
Jul 8, 2026
Merged

Semver2 fix 656#681
TheCommCraft merged 3 commits into
semver2from
semver2_fix_656

Conversation

@TheCommCraft

Copy link
Copy Markdown
Collaborator

Solves issue #656

Changes

Add 1 to every packet number requested, change packet request detection

Tests

@faretek1 faretek1 left a comment

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 left some general comments about the code but there is nothing critically obvious to the logic to me. As long as you have tested it well, it is probably safe to commit

Comment thread scratchattach/cloud/_base.py
self.last_var_set = time.time()

def get_var(self, var, *, recorder_initial_values={}):
def get_var(self, var, *, recorder_initial_values: Optional[dict] = None):

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.

If you really want to replicate the original behaviour you need to check if recorder... is None: recorder... = {}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The original behaviour was potentially dangerous due to a dangerous default

@faretek1 faretek1 Jul 8, 2026

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.

is cloud_recorder.CloudRecorder able to handle initial_values being set to None?

edit: I have checked, yes it does

return self.recorder.get_var(var)

def get_all_vars(self, *, recorder_initial_values={}):
def get_all_vars(self, *, recorder_initial_values: Optional[dict] = None):

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.

Same as above for none check

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.

Another option is to just make it a required field instead of optional

Comment thread scratchattach/cloud/cloud.py
Comment thread scratchattach/eventhandlers/cloud_requests.py
Comment thread scratchattach/eventhandlers/cloud_requests.py
Comment thread scratchattach/eventhandlers/cloud_requests.py Outdated
Comment thread scratchattach/eventhandlers/cloud_requests.py
Comment thread scratchattach/eventhandlers/cloud_requests.py Outdated
Comment thread scratchattach/eventhandlers/cloud_requests.py
@TheCommCraft

Copy link
Copy Markdown
Collaborator Author

applied some of the requested changes

self.last_var_set = time.time()

def get_var(self, var, *, recorder_initial_values={}):
def get_var(self, var, *, recorder_initial_values: Optional[dict] = None):

@faretek1 faretek1 Jul 8, 2026

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.

is cloud_recorder.CloudRecorder able to handle initial_values being set to None?

edit: I have checked, yes it does

Comment thread scratchattach/eventhandlers/cloud_requests.py
@TheCommCraft TheCommCraft merged commit 60cdbcc into semver2 Jul 8, 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