question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V6 doesn't recognize _embedded resources

See original GitHub issue

In version 5.2 _embedded resources won’t trigger a request per entry, but version 6 won’t recognize that the request contains _embedded resources and will instead make a GET request for each resources embedded.

Example:

 const articles = await ketting.follow('articles').followAll('articles')

    for (const resource of articles) {
      const state = await resource.get();
      console.log(state)
    }

The above code follows the root document link articles and then follows all embedded articles and logs them.

In version 5.2 it will simply log the _embedded resources from the initial request. But in version 6, the exact same code will trigger a GET request per entry.

A workaround The following example is a possible workaround. But I’m not sure this is how it’s intended to be used.

 const articles = await ketting.follow('articles')
 const fetchedArticles = await articles.get()

    for (const resource of fetchedArticles.embedded) {
      console.log(state)
    }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
evertcommented, Aug 10, 2020

@madsmadsen identified the core issue, I’m very grateful. The reason I hadn’t seen this is (sadly) because we were running a version of ketting 6 slightly older than current, and it’s a relatively new change.

PR and release will follow in the next 30 minutes.

Thank you @madsmadsen and everyone sending their debug information. Apologies for not spotting the error earlier.

1reaction
evertcommented, Jul 23, 2020

That is very strange… definitely a bug! nice catch. Would be ok sharing a sample HAL document? I’d like to make sure this is not some kind of edge case I missed, as I’ve not seen this problem myself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embedded resource won't work for some filenames?
If I have an embedded resource file called “light.sms.txt”, then it is not embedded, but if I change it to “light.sms1.txt”, then it...
Read more >
Cannot find embedded resource in referenced assembly
Two things to check: Make sure the Build Action property on the icon is set to Embedded Resource. Are you using the fully...
Read more >
Embedded Resources - Articles Tutorials | AspNet Boilerplate
First, we create a file and mark it as an embedded resource. Any assembly can contain embedded resource files. The process changes based...
Read more >
Tables and Views — PostgREST 9.0.0 documentation
PostgREST cannot detect a view as an embedded resource by using a column name or foreign key name as targets, that is why...
Read more >
MSP-FET: Device not recognized by V6.51 (or older) IAR ...
I have been able to work with IAR-Workbench V6.51 and older debugging ... for the IAR Embedded Workbench (EW) shared components and not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found