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

#159222976 Add id nonce to ensure new entry Id uniqueness #12

Merged
merged 1 commit into from
Jul 22, 2018

Conversation

olusoladavid
Copy link
Owner

What does this PR do?

Fixes bug that results from deleting an entry and adding a new entry in the previous build. Adding a new entry after a deletion results in entries with the same ids. This bug has been corrected with the use of an id nonce for generating ids for new entries.

Description of Task to be completed

  • Add idNonce variable that always increments for every new entry added
  • Increment idNonce when user adds a new entry
  • Assign id to new entry based on the id of idNonce's count property.
  • Integrate idNonce in tests

How should this be manually tested?

API endpoint has been deployed to: https://my-diary-api.herokuapp.com/api/v1

Using Postman:

  1. Send a GET request to /entries to retrieve a list of all available entries
  2. Send a DELETE request to /entries/:id for one of the available entries
  3. Send a POST request to /entries with body
    { "timestamp": 153462783, "title": "title", "content": "content", "isFavorite": true }
  4. Repeat step 1 and review the results.

What are the relevant pivotal tracker stories?

#159222976

@olusoladavid olusoladavid merged commit 402d49e into develop Jul 22, 2018
@coveralls
Copy link

Pull Request Test Coverage Report for Build 34

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 32: 0.0%
Covered Lines: 51
Relevant Lines: 51

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants