satisfactorymodding / satisfactorymodding/FICSIT-Fred

No response when errored on corrupted zip

Open
#195 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Python
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Example bad zip: https://discord.com/channels/555424930502541343/1421307552079155253/1421312563320455239

File is not a zip file

  File "/app/venv/lib/python3.12/site-packages/nextcord/client.py", line 527, in _run_event
    await coro(*args, **kwargs)
  File "/app/fred/fred.py", line 321, in on_message
    _reacted = await self.Crashes.process_message(message)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/fred/cogs/crashes.py", line 365, in process_message
    raise ex
  File "/app/fred/cogs/crashes.py", line 354, in process_message
    jobs.extend((task_group.create_task(job) for job in self._get_file_jobs(name, file)))
  File "/app/fred/cogs/crashes.py", line 354, in <genexpr>
    jobs.extend((task_group.create_task(job) for job in self._get_file_jobs(name, file)))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/fred/cogs/crashes.py", line 257, in _get_file_jobs
    zip_file = ZipFile(file)
               ^^^^^^^^^^^^^
  File "/usr/lib/python3.12/zipfile/__init__.py", line 1354, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.12/zipfile/__init__.py", line 1421, in _RealGetContents
    raise BadZipFile("File is not a zip file")

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cogs/crashes.py at _get_file_jobs around line 257, then trace how process_message handles jobs around lines 354-365. Reproduce the reported corrupted ZIP case and inspect the BadZipFile path. Done means this input receives an appropriate response instead of producing no response.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.