Skip to content

Bug: /myfunc endpoint crashes with TypeError #44

@linisha15

Description

@linisha15

Description

The /myfunc endpoint (used for case backup) crashes when accessed. The root cause appears to be a constructor argument mismatch: the Download class constructor expects two arguments but is called with only one.

Why This Matters

  • Any attempt to use the backup/export feature crashes the server
  • Users cannot export their cases
  • This endpoint is currently non-functional

Location

File: API/Routes/Upload/UploadRoute.py
Lines:** 197–203

Current Code (Problem)

class Download(Thread):
    def __init__(self, request, zippedFile):  # Expects 2 args
        ...

However, it is instantiated as:

thread_a = Download(request.__copy__())  # Only 1 arg passed → TypeError

How to Reproduce
Make a GET request to /myfunc
Observe server error: TypeError: init() missing 1 required positional argument: 'zippedFile'

Expected Behavior
/myfunc should work like /backupCase (which correctly passes 2 arguments)
Server should not crash; user should receive a valid ZIP response

Acceptance Criteria

  • Pass the zippedFile argument when instantiating Download in /myfunc (line 200)
  • /myfunc responds with a ZIP file or appropriate error message instead of crashing
  • /backupCase endpoint continues to work as before

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions