Back

[function] not* deploying properly

  • 0
  • Functions
Francisco "Klogan" Barros
19 Jan, 2024, 23:23

When I create a new user, the ProcessNewUser (id,name) serverless Appwrite Function triggers. It retrieves the user $id from the event payload (req.body). It tries to create some default documents for that user.

This function used to work before some personal refactors, related with type-safety, maintainability and most importantly, new data models. Now, I did not expect to get the refactor just right first time around. However, whenever I create a new user and the function triggers, an old version of the code gets executed (tried multiple times over the last hour).

Entrypoint:

  • ./dist/process-new-user/main.js Git Settings:
  • Points at branch development development Build command:
  • bun install && bun build ./functions/process-new-user/main.ts --outdir ./dist/process-new-user ;

Symptoms

  • When doing commits to the repository to the development branch, I have noticed that builds are not triggered as they usually do
  • When manually deploying, a new deployment is made, goes to status active, but when the functions executes it shows Log messages that I no longer have (old code, before refactor).

Some help?

Screenshots attached.

TL;DR
Title: Function not deploying properly - Developer created a new user triggering the `ProcessNewUser` function - It tries to create default documents for the user - However, after personal refactors, an old version of the code keeps executing - Commits to the repository are not triggering builds as expected - Manually deploying shows a new deployment with an active status, but the old code runs - Developer seeks help Solution: It seems there may be an issue with the build and deployment process. The developer can try the following steps: 1. Ensure that the build command is correctly set to `bun install &&
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more