Giter VIP home page Giter VIP logo

Comments (10)

neonexus avatar neonexus commented on July 20, 2024 1

Only thing I think of to help debug this, would be to check out the RequestLog model data (custom to this repo / start kit). This would give you some insight into what is going on with your API calls at least. I built the api/hooks/request-logger.js, api/models/RequestLog.js, and api/helpers/finalize-request-log.js, to help with issues just like this.

Another idea that comes to mind; CSRF protection I built forces modification requests (POST / PUT / DELETE) to be serial, and can't be parallel, because the CSRF token is single-use, and rotates after each use. I did not build it to handle parallel requests per session. GET requests can be parallel, as they don't spend CSRF tokens. It is possible parallel requests are being made, and if so, would cause this kind of issue, as the system is designed to log the user out if they give a bad CSRF token.

from sails-react-bootstrap-webpack.

neonexus avatar neonexus commented on July 20, 2024 1

Ah, sounds like you need a rerender blocker (at least, that's what I call it). The way I implement this, is I set an initial state variable in the constructor (something like this.state.hasLoaded) to false, wrapping all of the contents of render() in an if statement, returning null if loading is still going. Then, after I've made whatever API calls, or setup of whatever, I update the state variable to true, forcing a rerender when I want it, not when React does.

from sails-react-bootstrap-webpack.

neonexus avatar neonexus commented on July 20, 2024 1

Glad I could help, and glad you are finding my repo useful! It only took me about 20 something-ish years to build it XD (I've been learning how to program for 20+ years, 10 years professionally). A lot of things I found myself repeating over the years has been distilled into this repo (and the little npm repo [fixted] I took over to help test Sails).

There are still things I'm working on, to make the demo a bit better. So, keep an eye out.

from sails-react-bootstrap-webpack.

neonexus avatar neonexus commented on July 20, 2024 1

@MaheshkumarSundaram Thanks! I always strive for the most straightforward way of building something. The less comments I have to make, to make the code understandable, the better.

from sails-react-bootstrap-webpack.

MaheshkumarSundaram avatar MaheshkumarSundaram commented on July 20, 2024

Thank you for your apt response.

I checked the RequestLog. The issue seems to be due to parallel requests because when using Strict mode, my POST API call is called twice (using the same CSRF token) due to the rerendering.

from sails-react-bootstrap-webpack.

MaheshkumarSundaram avatar MaheshkumarSundaram commented on July 20, 2024

Yeah. Exactly. That's what I am doing now to get rid of the issue. Thanks for your help. Much appreciated.

from sails-react-bootstrap-webpack.

MaheshkumarSundaram avatar MaheshkumarSundaram commented on July 20, 2024

@neonexus ,

Well done to your efforts. Your repo is really worth it. It saved me an incredible amount of time when I started my Sails-React web application. If you would like any help with its future dev, please feel free to reach out. I would gladly help in areas I could. Thank you!

from sails-react-bootstrap-webpack.

neonexus avatar neonexus commented on July 20, 2024

I'm always open to some help @MaheshkumarSundaram. I just commited a bunch of work I've been doing to master. The most notable update is the PwnedPasswords.com API integration (HaveIBeenPwned.com). Well worth a look, and I'll make it a release soon. be8fc13#diff-76587a1ff3ab9997f53a0c19016f6dd4e2dbe76ed7307b99e577947419c4c5bdR39

from sails-react-bootstrap-webpack.

MaheshkumarSundaram avatar MaheshkumarSundaram commented on July 20, 2024

Hi @neonexus,

Thanks for your update. I'll check that out.

One more request. Could you please open the Discussion tab for the project?
It would be very useful to have conversations regarding development instead of raising issues.
Thank you!

from sails-react-bootstrap-webpack.

MaheshkumarSundaram avatar MaheshkumarSundaram commented on July 20, 2024

I'm always open to some help @MaheshkumarSundaram. I just commited a bunch of work I've been doing to master. The most notable update is the PwnedPasswords.com API integration (HaveIBeenPwned.com). Well worth a look, and I'll make it a release soon. be8fc13#diff-76587a1ff3ab9997f53a0c19016f6dd4e2dbe76ed7307b99e577947419c4c5bdR39

Hi @neonexus,

I checked out your PwnedPasswords.com API integration in your master branch. It's an elegant and clear functionality. Nice work and concisely done! 🎉🎉🎉

from sails-react-bootstrap-webpack.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.