Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improveinstalled.json handling inv2/tools#983

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@MatteoPologruto
Copy link
Contributor

@MatteoPologrutoMatteoPologruto commentedAug 1, 2024
edited
Loading

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among thePull Requests
    before creating one)
  • Tests for the changes have been added (for bug fixes / features)
  • What kind of change does this PR introduce?

Code enhancement

  • What is the current behavior?

Theinstalled.json is read everytime it needs to be updated and there is no mutex policy to prevent file corruption.

  • What is the new behavior?

Information frominstalled.json is stored in a map and a mutex policy is introduced.

  • Does this PR introduce a breaking change?

No

  • Other information:

@MatteoPologrutoMatteoPologruto added type: enhancementProposed improvement topic: codeRelated to content of the project itself labelsAug 1, 2024
@MatteoPologrutoMatteoPologruto self-assigned thisAug 1, 2024
@codecov-commenter
Copy link

codecov-commenter commentedAug 1, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is89.65517% with3 lines in your changes missing coverage. Please review.

Project coverage is 20.70%. Comparing base(6287df1) to head(33f59b5).

FilesPatch %Lines
v2/pkgs/tools.go88.46%2 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main     #983      +/-   ##==========================================+ Coverage   20.01%   20.70%   +0.68%==========================================  Files          42       42                Lines        2568     2565       -3     ==========================================+ Hits          514      531      +17+ Misses       1968     1949      -19+ Partials       86       85       -1
FlagCoverage Δ
unit20.70% <89.65%> (+0.68%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@MatteoPologrutoMatteoPologruto marked this pull request as ready for reviewAugust 1, 2024 14:25
@MatteoPologrutoMatteoPologruto linked an issueAug 1, 2024 that may beclosed by this pull request
@Xayton
Copy link
Contributor

Before merging, we also need to add some code that, if theinstalled.json file is not parsable, it will delete it and retry, instead of panicking.

umbynos reacted with thumbs up emoji

@XaytonXayton added this to the1.6.1 milestoneAug 5, 2024
@MatteoPologruto
Copy link
ContributorAuthor

MatteoPologruto commentedAug 5, 2024
edited
Loading

Before merging, we also need to add some code that, if theinstalled.json file is not parsable, it will delete it and retry, instead of panicking.

This commit solves this issue. Theinstalled.json is parsed only when theTools struct is initialized and errors are ignored. If the json is corrupted, theinstalled map remains empty and any tool is downloaded from scratch, rewriting theinstalled.json file.

@XaytonXayton removed this from the1.6.1 milestoneAug 5, 2024
@MatteoPologrutoMatteoPologruto merged commita679bf3 intoarduino:mainAug 5, 2024
@MatteoPologrutoMatteoPologruto deleted the corrupted-json-fix branchAugust 5, 2024 14:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@XaytonXaytonXayton approved these changes

+1 more reviewer

@umbynosumbynosumbynos approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@MatteoPologrutoMatteoPologruto

Labels

topic: codeRelated to content of the project itselftype: enhancementProposed improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Agent error while installing tools (installed.json corruption)

4 participants

@MatteoPologruto@codecov-commenter@Xayton@umbynos

[8]ページ先頭

©2009-2025 Movatter.jp