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

📚 Documentation: Adding sleep /wait function to quick start guide for node-sdk for better first experience #1785

Open
2 tasks done
sahilsekr42 opened this issue Feb 19, 2025 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@sahilsekr42
Copy link
Contributor

💭 Description

In the quick start guide for node.js-sdk there is a function runAllTasks

async function runAllTasks() { await prepareDatabase(); await seedDatabase(); await getTodos(); } runAllTasks();

This is just for devs to get started. Now, I observed that running seedDatabase() immediately after preparing the db throws error related to attribute recognition . As far as I can tell the database in background is taking some time to be prepared . Waiting for a couple seconds between both functions solves this.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@sahilsekr42 sahilsekr42 added the documentation Improvements or additions to documentation label Feb 19, 2025
@sahilsekr42
Copy link
Contributor Author

Going to create a PR with the sleep/wait function included

@sahilsekr42
Copy link
Contributor Author

Hello, @stnguyen90 @LauraDuRy @ItzNotABug , its a humble request to please check the PR and suggest or make any changes if possible. Thanks !!

@ItzNotABug
Copy link
Member

What do you mean by - error related to attribute recognition? Can you share the full error/stacktrace?
In most cases, a sleep or pause like logic is not required since all the operations are async and hence the calls are awaited.

@sahilsekr42
Copy link
Contributor Author

Hey @ItzNotABug ,thanks for taking time to look into it. Well , the error was attribute "title" not recognised. This happened when seedDatabase function tried to add documents. Whereas after adding a wait time of couple seconds it was automatically recognised because maybe the backend is taking time to be prepared and then respond accurately to requests. Also I was running a local appwrite instance so maybe my system is slow.

@sahilsekr42
Copy link
Contributor Author

Also , just following the quick-start guide for node-sdk should reproduce the error. I used a local appwrite instance. @ItzNotABug

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

No branches or pull requests

2 participants