FlatFilers / platform-sdk-starter

Basic starter for platform sdk
5 stars 23 forks source link

Hook functions recordCompute and batchRecordsCompute not working #103

Closed haithai1376 closed 9 months ago

haithai1376 commented 9 months ago

The hook functions recordCompute and batchRecordsCompute within the Sheet below aren't functioning as expected. Here is the code:

recordCompute: (record) => {
      const fullName = `{record.get('firstName')} {record.get('lastName')}`;
      record.set("fullName", fullName);
      return record;
 },
batchRecordsCompute: async (payload: FlatfileRecords<any>) => {
  const response = await fetch("https://api.us.flatfile.io/health", {
    method: "GET",
    headers: {
      Accept: "application/json",
    },
  });
  const result = await response.json();
  payload.records.map(async (record: FlatfileRecord) => {
    record.set("fromHttp", result.info.postgres.status);
  });
},

I've attempted to deploy templates and portals for testing, but the 'compute' hook is not working. Has there been any change from the last time? I did some validating and combining of values just two days ago, and it didn't work.

The problem I got an error below and I can't resolve it from my console Screenshot 2024-02-01 at 3 39 11 PM

Arsik36 commented 9 months ago

Hey, thank you for reaching out to us. I can also reproduce this on my end and flagged to the team as the highest priority issue. I recognize this is a breaking experience, and you should expect to hear back from me shortly on this.

haithai1376 commented 9 months ago

Great, @Arsik36 , We have a lot of customers who are using the features related to Flatfile. I hope the team can fix it as soon as possible.

Arsik36 commented 9 months ago

Can you please try to deploy a new hook, and let me know if you see it deploy successfully?

haithai1376 commented 9 months ago

Okie let me give it a shot

haithai1376 commented 9 months ago

Screenshot 2024-02-01 at 10 52 24 PM @Arsik36 The error is still happening...

haithai1376 commented 9 months ago

Hi @Arsik36, could you give me some insight into what's going on now so I can explain it to our customers?

Arsik36 commented 9 months ago

We noticed that lambda storage was running out of resources and we cleaned that up. In our tests we saw this intermittently work so I asked you to retest. Now I again see the issue and we are looking into what may be causing this

JillChenPlayonSports commented 9 months ago

@Arsik36 Hi Arsik, is it possible for the engineers to restore our latest working deployment to at least get it running?

Arsik36 commented 9 months ago

Just confirmed with engineers - we cannot unfortunately restore this, the only way to resolve this is a forward fix deploy on our side. We are finalizing a query to resolve the issue with a function responsible for hooks. We have identified the issue and expect this to be resolved shortly

Arsik36 commented 9 months ago

We believe this is now resolved, can you please test and confirm? In my tests I saw hooks deploy as expected

JillChenPlayonSports commented 9 months ago

@Arsik36 I just redployed but still seeing the failed deployment

image
Arsik36 commented 9 months ago

Can you please try again? We just had 2 customers confirm this is resolved for them on a new deploy.
To try, can you add a test field to your template, and just slightly change a key or name of a Portal? That will create new ID values for them and you should see it work

JillChenPlayonSports commented 9 months ago

@Arsik36 I have 4 templates, do I need to add test field in every template?

Arsik36 commented 9 months ago

Yes please, just to generate new ID values for them. Redeploy should work, and then you will be safe to remove those

JillChenPlayonSports commented 9 months ago

@Arsik36 it worked for us! thank you! I wonder if it is ok for us to remove the test field and deploy again?

haithai1376 commented 9 months ago

Resolved Thanks @Arsik36