Skip to content

fix: 修复 #35 #36 #38 - #39

Merged
farshore07 merged 6 commits into
AimerSo:mainfrom
farshore07:main
Jun 28, 2026
Merged

fix: 修复 #35 #36 #38#39
farshore07 merged 6 commits into
AimerSo:mainfrom
farshore07:main

Conversation

@farshore07

Copy link
Copy Markdown
Collaborator

No description provided.

@farshore07

Copy link
Copy Markdown
Collaborator Author

@codex 审查提交

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 238220524d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread services/sound_replace_service.py Outdated
Comment on lines 633 to 635
if self._sha256(target_path) != entry.get("replacement_sha256"):
skipped_files.append({"target_rel": target_rel, "reason": "target_changed_externally"})
remaining_entries.append(entry)
skipped_files.append({"target_rel": target_rel, "reason": "target_changed_externally", "record_cleared": True})
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep manifest entries for unresolved external changes

When the tracked target hash differs because the user or another tool installed a third-party sound file, this branch now drops the entry from active_entries instead of keeping it. After restore() returns this skipped result, get_status() reports the game as clean and the original backup is no longer reachable through the normal restore flow, leaving the external file installed. Only clear the record when the current hash is known to be the original (for example it matches original_sha256); otherwise keep the entry so the user can still recover or retry.

Useful? React with 👍 / 👎.

Comment thread main.py Outdated
Comment on lines +371 to +373
lock_path = lock_path or (Path(tempfile.gettempdir()) / "AimerWT.single-instance.lock")
try:
lock_file = open(lock_path, "a+b")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the instance lock out of shared temp

On Unix systems where tempfile.gettempdir() is a shared /tmp, this creates a persistent lock file owned with the first user's umask permissions. Once one user has run the app, another user can hit PermissionError on open(..., "a+b") even after the lock is released, and the except OSError path treats that stale permission failure as “already running,” blocking launch. Put the lock in a per-user runtime/config directory or create it with permissions that do not make other users' stale files look like an active instance.

Useful? React with 👍 / 👎.

@farshore07

Copy link
Copy Markdown
Collaborator Author

@codex 审查最新提交

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faa19322af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +641 to +645
record_cleared = bool(original_sha and current_sha == original_sha)
skipped_files.append({
"target_rel": target_rel,
"reason": "target_changed_externally",
"record_cleared": record_cleared,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat cleared restore records as completed

When a user has already verified/restored the game file outside AimerWT, this new record_cleared path removes the active manifest entry but only records it as a skipped file, leaving restored_entries empty; restore() therefore returns success: False later even though the stale record was successfully cleared. AppApi.restore_game only clears current_mod and fires the success path when sound_result.success is true, so the UI can report “Sound restore incomplete” and keep the installed-mod marker stale after all active entries have been cleared.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant