Has something happened to the ~/api/v1/tags endpoint?

At around 13:50 UTC we noticed a load of errors which relate to this endpoint.

We're using GitHub - prismicio/javascript-kit: Development kit for the Javascript language

Our code is doing the following:

  1. Create a new Prismic API client.

  2. For every form on prismicClient.data.forms, call the Prismic API client with .for(form).

  3. Map any applicable fragments off of each returned document.

The problem now comes from a tags form on the API client, which attempts to hit ~/api/v1/tags in step 2, but errors.

We haven't been made aware of any breaking changes to this effect.

Thanks

Hello Chris,

Sorry to hear that you're having issues.

In the meantime we disabled the /api/v1/tags endpoint for you so your website should not break anymore. But we will need to re-enable it very soon.

Can you give me the Error and the eventual stack trace you were getting ? Also a snippet of code to reproduce it would be good.

Also i strongly recommend you to migrate to GitHub - prismicio/prismic-javascript: Official JavaScript + TypeScript client library for Prismic which is newer and up to date. In fact, as you can see we don't update anymore GitHub - prismicio/javascript-kit: Development kit for the Javascript language .

Thanks

Hi Raphael,

We rushed out a fix, before you disabled the endpoint, so we're not sure if that will help. Will it prevent tags from appearing on prismicClient.data.forms?

Here's some cobbled-together code:

const {Prismic} = require('prismic.io');
Prismic.Api(prismicEndpoint, (err, prismicClient) => {
  prismicClient.data.forms.forEach(form => {
    prismicClient.form(form).ref(prismicRef).submit((err, res) => {
      // Do something with res
    });
  });
});

And an example stack trace:

Error: Unknown field ref
  at Object.SearchForm.set (~/our-app/node_modules/prismic.io/dist/prismic.io.js:460:34)
  at Object.SearchForm.ref (~/our-app/node_modules/prismic.io/dist/prismic.io.js:484:25)
  at submitForm (~/our-app/some-code.js:46:7)
  at ~/our-app/some-code.js:120:12
  at createPrismicClient (~/our-app/some-code.js:17:10)
  at Object.prismicSubmit [as submit] (~/our-app/some-code.js:106:4)
  at ~/our-app/some-code.js:89:32
  at ~/our-app/node_modules/async/lib/async.js:356:13
  at async.forEachOf.async.eachOf (~/our-app/node_modules/async/lib/async.js:233:13)
  at _asyncMap (~/our-app/node_modules/async/lib/async.js:355:9)

It would be a significant amount of work for us to migrate to your new library. We really just need confidence that we're being notified of all breaking changes, because your related blog post didn't prepare us for this.

Hi Chris,

In fact your code should work. But as i said we don't update this kit anymore. If it doesn't work i advise you just to just filter the tags form. If i take your code, it will look something like:

const {Prismic} = require('prismic.io');
Prismic.Api(prismicEndpoint, (err, prismicClient) => {
  prismicClient.data.forms.forEach(form => {
    if (form !== 'tags') {
      prismicClient.form(form).ref(prismicRef).submit((err, res) => {
        // Do something with res
      });
    }
  });
});

About the communication on the change, we sent out multiple emails about the upcoming change over 3 months ago and it’s seems you were unsubscribed from our mailing list. Would you like us to re-subscribe your email address to receive further updates?

Regards

Hi Raphael,

That's pretty much the fix we ended up implementing.

We did receive the communication about the change (via another subscribed email address) and we got in touch at the time, to try and avoid any incidents. After that, we were fairly confident that we weren't using the deprecated "tags" property, so took no action. We still don't understand how the changes described in your blog post have any relation to the separate "forms" property, to which this issue seems to relate.

We appreciate that you no longer maintain this library, but we're still very reliant on it and there's absolutely no way we could have anticipated it breaking, from your information in the communications.

Kind regards

Hi Chris,

I agree it would have been very hard for you or your team to anticipate that this change would cause such an issue. This is a specific edge case and even so, I've passed your concerns to the rest of the dev team about the issues this change caused with this kit.

I don't imagine there will be any updates made to that kit, but this experience will help us think about such cases in the future so that we can work on ensuring that something like this doesn't occur again.

Thank you for understanding and apologies again.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.