Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission counts endpoint doesn't omit deleted submissions #4667

Closed
magicznyleszek opened this issue Sep 27, 2023 · 2 comments
Closed

Submission counts endpoint doesn't omit deleted submissions #4667

magicznyleszek opened this issue Sep 27, 2023 · 2 comments
Assignees
Labels
Back end low priority To be done later

Comments

@magicznyleszek
Copy link
Member

Description

The /api/v2/assets/<uid>/counts/ endpoint includes deleted submissions in the daily counts.

Steps to Reproduce

  1. Create new project
  2. Deploy
  3. Add one submission
  4. Note that /api/v2/assets/<uid>/counts/ returns:
    {
      "daily_submission_counts": {
        "2023-09-27": 1
      },
      "total_submission_count": 1
    }
    
  5. Go to Data Table and delete the submission
  6. Note that /api/v2/assets/<uid>/counts/ now returns:
    {
      "daily_submission_counts": {
        "2023-09-27": 1
      },
      "total_submission_count": 0
    }
    
  7. 🐛

Expected behavior

I think that daily_submission_counts should be an empty object?

@magicznyleszek
Copy link
Member Author

@JacquelineMorrissette assigned this to you as you wrote the endpoint code #3984 - feel free to unassign yourself though :)

@jnm
Copy link
Member

jnm commented Sep 27, 2023

The daily_submission_counts are behaving as intended. Once a submission is received, it has contributed to the strain on our infrastructure, and it counts as usage. These counters are never decremented when submissions are deleted.

I'm unsure whether or not total_submission_count decreasing from 1 to 0 is desired. Regarding this, @LMNTL mentions:

That might need to be retested with the most updated release; I think that was related to the null XForm counter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back end low priority To be done later
Projects
None yet
Development

No branches or pull requests

3 participants