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

BUG: Recipies dont get populated when starting fresh #111

Closed
3 tasks done
sadath2001 opened this issue Oct 6, 2024 · 6 comments
Closed
3 tasks done

BUG: Recipies dont get populated when starting fresh #111

sadath2001 opened this issue Oct 6, 2024 · 6 comments
Labels
gssoc-ext For GSSOC Extended Contribution. hacktoberfest-accepted invalid Not Valid Issue

Comments

@sadath2001
Copy link
Contributor

Is there an existing issue raised for this?

  • I have searched the existing issues

Describe your issue

Hi,
I found a bug recently.
When i create a new account, and then i login, initially there would be no recipies.
When i try adding the recipie, it shows internal error.

Steps to reproduce

  1. Create a new account
  2. Add a new recipie
  3. You could see an error

What was the expected result?

The recipie shouldve been added succesfully

Proposed solution

i could see that there is a slight issue in the code:
const lastDocument = await Recipe.findOne().sort({ _id: -1 });
const unique = lastDocument._id.toString()

 the above code would fetch the last documentid to generate a unique id.

Since there is no last document, it throws an error.

I have to try and check by testing to fix this issue.

Kindly assign this to me

Would you like to work on this issue?

Yes

Terms & Conditions

  • I agree to follow the Code of Conduct
  • I'm a GSSOC'24 Ext contributor
@github-actions github-actions bot added gssoc-ext For GSSOC Extended Contribution. hacktoberfest-accepted labels Oct 6, 2024
@sadath2001
Copy link
Contributor Author

I saw this bug, when i was trying to insert something from my localmachine.

@AlfiyaSiddique
Copy link
Owner

@sadath2001 does this issue still exists?
Not able to repro it on prod, it's working fine

@sadath2001
Copy link
Contributor Author

@sadath2001 , yes, it does, only when we start fresh, i.e there are no existing recipes at all in the application. In which case, i will point to undefined.

@AlfiyaSiddique
Copy link
Owner

@sadath2001 I tried to repro this issue using a new account but it works fine.
Can you present some video to confirm this is a valid bug.

@AlfiyaSiddique AlfiyaSiddique added the question Further information is requested label Oct 9, 2024
@sadath2001
Copy link
Contributor Author

github.mp4

Its no longer an issue, since i applied the fix to this in the recipie validation PR. so i believe this can be closed.

@AlfiyaSiddique
Copy link
Owner

Okay then closing this issue.

@AlfiyaSiddique AlfiyaSiddique closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
@AlfiyaSiddique AlfiyaSiddique added invalid Not Valid Issue and removed question Further information is requested labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc-ext For GSSOC Extended Contribution. hacktoberfest-accepted invalid Not Valid Issue
Projects
None yet
Development

No branches or pull requests

2 participants