cortex-lab / cortex-lab/alyx

Session gets created in db even when request error response

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

Nobody has claimed this yet.

Dominant language
Python
Stars
52
Forks
12
Avg merge
1d 11h
Merged PRs (30d)
4

Description

Reporting what I believe is a bug:
when trying to POST a new session (on a python script), I passed a dictionary like this in the data field of the request:
data = { "subject": "subject2"}

This returns a HTTP error, and that’s because I was missing the users list. However, the Session gets created in the database, with an empty list of users!

Now, is that the expected behavior? If I get a http error from my POST request, I wouldn’t expect the POST to be successful.

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 at the Django endpoint that handles POST requests for creating sessions, then inspect how validation errors and database writes are sequenced. Reproduce the request with only the subject field and check whether the failed response leaves a Session record; done means the error response does not persist a new session, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.