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 tracker] New deployed API #712

Closed
9 of 10 tasks
geromegrignon opened this issue Aug 23, 2021 · 27 comments
Closed
9 of 10 tasks

[Bug tracker] New deployed API #712

geromegrignon opened this issue Aug 23, 2021 · 27 comments

Comments

@geromegrignon
Copy link
Contributor

geromegrignon commented Aug 23, 2021

Update
The temporary API will be shut down on Nov 1st as being now available on the original URL https://conduit.productionready.io/api

A new API is deployed to fix the following issues:

  • performance
  • NSFW content

This new API is a temporary solution as we can't deploy on the productionready.io domain.
API URL: https://realworld-temp-api.herokuapp.com/api

I chose not to use an existing backend implementation but to create a new one as a starter for the incoming V2.
Please add a comment here if you find any bugs while using this new API.

Bug tracker:

  • GET /api/articles/feed doesn't retrieve data as expected
  • GET /api/articles/:slug/comments response doesn't match the specs format
  • article related tags aren't deleted on cascade when an user deletes an article
  • login with incorrect credentials fails with a CORS error
  • error messages don't match the spec format
  • refresh token (won't be fixed for this version)
  • GET /api/articles/:slug/comments author info not included
  • missing default avatar image
  • articlesCount using offset/limit
  • favorite endpoints don't return the tagList with the expected format
@raulsebastianmihaila
Copy link

@geromegrignon thanks for the temporary API! It seems that login with incorrect credentials fails with a CORS error instead of the expected response.

@geromegrignon
Copy link
Contributor Author

@geromegrignon thanks for the temporary API! It seems that login with incorrect credentials fails with a CORS error instead of the expected response.

Hello, I just fixed it.

@raulsebastianmihaila
Copy link

Cool! However it doesn't follow the spec. As is, it breaks the crizmas-mvc implementation. I think the response should be something like:

{
  "errors": {
    "email or password": [
      "are incorrect"
    ]
  }
}

@geromegrignon
Copy link
Contributor Author

geromegrignon commented Aug 23, 2021

@raulsebastianmihaila fixed too.

 errors: {
  "email or password": [
     'is invalid'
    ]
}

@Allianzcortex
Copy link

Allianzcortex commented Aug 23, 2021

@geromegrignon Hi , a follow-up from morning's 401 authorized issue .

  • What happened :

It shows 401 Unauthorized :

image

  • Steps to reproduce :

a. register & login & fetch the feed , so far so good

b. after sometime(I guess JWT expiration time ?) , when trying to refresh the feed , will get the above error . If cleaning the token in local storage, then it will work again.

Token is sent in header :

image

@geromegrignon
Copy link
Contributor Author

@geromegrignon Hi , a follow-up from morning's 401 authorized issue .

  • What happened :

It shows 401 Unauthorized :

image

  • Steps to reproduce :

a. register & login & fetch the feed , so far so good

b. after sometime(I guess JWT expiration time ?) , when trying to refresh the feed , will get the above error . If cleaning the token in local storage, then it will work again.

Token is sent in header :

image

I changed the token duration from 100 minutes to 7 days.
It won't fix the problem but will give me time to prioritize tasks.
I'm not used to developing backend apps and being more used to consume auth on the frontend side than producing one!

@Allianzcortex
Copy link

@geromegrignon Hi , a follow-up from morning's 401 authorized issue .

  • What happened :

It shows 401 Unauthorized :
image

  • Steps to reproduce :

a. register & login & fetch the feed , so far so good
b. after sometime(I guess JWT expiration time ?) , when trying to refresh the feed , will get the above error . If cleaning the token in local storage, then it will work again.
Token is sent in header :
image

I changed the token duration from 100 minutes to 7 days.
It won't fix the problem but will give me time to prioritize tasks.
I'm not used to developing backend apps and being more used to consume auth on the frontend side than producing one!

yet another producer-consumer problem LOLL

@geromegrignon
Copy link
Contributor Author

changed the token duration to 60 days to match the current deployed API :

def generate_jwt
    JWT.encode({ id: id,
                 exp: 60.days.from_now.to_i },
               Rails.application.secrets.secret_key_base)
  end

@Allianzcortex
Copy link

Allianzcortex commented Aug 23, 2021

@geromegrignon find an issue(should be the last one..) here. For comment :

https://github.com/gothinkster/realworld/tree/master/api#single-comment

image

Here backend should return whole author object instead of authorId.

@geromegrignon
Copy link
Contributor Author

@Allianzcortex fixed too. Thanks for reporting it!

@Allianzcortex
Copy link

Allianzcortex commented Aug 25, 2021

@geromegrignon another small issue here : In old implementation , when we retrieve the feed : we can get min(articleCount,500) value which can help us do pagination

image

And currently articles count is only the count we return (ie there will only be 1st page always)
image

@geromegrignon
Copy link
Contributor Author

@Allianzcortex fixed too (i was filtering on offset/limit)

@HoPGoldy
Copy link

HoPGoldy commented Sep 2, 2021

@geromegrignon Thank you for providing this api endpoints! I found a bug about api/articles/{slug}/favorite:

When request this api, tagList in the returned article content become an object array instead of strings array:

image

@geromegrignon
Copy link
Contributor Author

geromegrignon commented Sep 2, 2021

Hey @HoPGoldy, thanks for reporting it.
It should be fixed by now (for both POST and DELETE on this endpoint).

@geromegrignon geromegrignon unpinned this issue Sep 12, 2021
@Allianzcortex
Copy link

@geromegrignon seems the register function is losing the temper now ?

image

@geromegrignon
Copy link
Contributor Author

@Allianzcortex Thanks!

I made some refactoring to open-source the API source code soon and it resulted in a new bug.
It's now fixed!

@geromegrignon
Copy link
Contributor Author

@raulsebastianmihaila @Allianzcortex the temporary api is now deployed on the original domain: conduit.productionready.io.
You can update the URL of your implementations.

Feel free to provide me feedback

@Allianzcortex
Copy link

@geromegrignon COOOOOLLL. And also looking forward to the open-source of the new implementation!

@geromegrignon
Copy link
Contributor Author

@Allianzcortex the repository is here: https://github.com/gothinkster/node-express-prisma-v1-official-app
The deployed branch is the limited one (with demo account, a cron to delete data on a regular basis, and fake data).

@geromegrignon
Copy link
Contributor Author

geromegrignon commented Sep 28, 2021

@raulsebastianmihaila and @Allianzcortex don't waste your time to test conduit.productionready.io for now.

There are some bugs :
conduit.productionready.io being used on a Heroku project we don't own, we had to make a redirection through realworld.io

Such a redirection results in cors errors and query params not passed with the redirection.

@geromegrignon
Copy link
Contributor Author

The API now works as expected, I created a PR on repositories using the temporary API.

@ghost
Copy link

ghost commented Oct 24, 2021

error: 404 Not Found /api/articles when creating new article

@Allianzcortex
Copy link

hmm interesting @mdsadiqueinam could u provide the payload u use ? I just tested it on my website (https://react-typescript-hooks-realworld.vercel.app/) which uses new API implementation, and a new post can be created successfully.

image

@ghost
Copy link

ghost commented Oct 24, 2021

I used this https://realworld-temp-api.herokuapp.com/api from swagger ui

@Allianzcortex
Copy link

@mdsadiqueinam This API also can't read the feed. The issue should be on how it's deployed rather than how it's implemented.

image

@geromegrignon
Copy link
Contributor Author

Hey @mdsadiqueinam,

It might be due to conflicts between the api itself and the swagger documentation.

Anyway, i encourage you to follow our documentation about the api : https://gothinkster.github.io/realworld/docs/specs/frontend-specs/api

As stated few messages ago, the original api url is now live. I plan to shutdown the temp one soon to avoid multiple maintenance efforts.

@geromegrignon
Copy link
Contributor Author

The temporary API will be shut down on Nov 1st as being now available on the original URL https://conduit.productionready.io/api

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

No branches or pull requests

4 participants