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.

ContentNodeSlim "popular" view can return an empty string as response

See original GitHub issue

Observed behavior

Related to #5407, a request to /api/content/contentnode_slim/popular/?by_role=true&include_fields=num_coach_contents&contentCacheKey=1556915747

Is returning a 200 response with "" on my local version, which in turn causes the problem in #5407. The other detail view (“resume” and “next_steps”) are working correctly.

In the Network inspector in chrome dev tools

Screen Shot 2019-05-06 at 11 57 22 AM

I do not know what, specifically, is causing the “popular” view to return nothing.

Expected behavior

Assuming, this is a legitimate response to, for example, not having any “popular” resources, a call to this endpoint returns something acceptable to the Api Resource class, like [].

User-facing consequences

Servers with the same conditions as mine (whatever they are) will not have a working “Learn > Recommended” page.

Errors and logs

Steps to reproduce

Context

0.12. develop

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
rtibblescommented, May 14, 2019

Right, either would work.

0reactions
jonboisercommented, May 14, 2019

Implemented the solution above in #5486. In local development mode, the use-the-cache branch should always be bypassed, and the view returns Response(serializer.data).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Controller return view or empty string to ajax request
You trying to return empty path to browser and you get 404. It's normal. Try to return String with path to controller that...
Read more >
ServiceNow REST APIs returns empty string ("") in
Hi All, ServiceNow REST APIs returns empty string ("") in response if there is no value/data available for fields. Behaviour is same for....
Read more >
Use empty string, null or remove empty property in API request ...
For example, my common setup for Newtonsoft.Json translates null/missing properties to/from F# option types only and will otherwise error.
Read more >
Return empty string from json() if byteLength of cloned ...
(We have to clone the response (or, at least, do something special) because once we read the response body, we can't read it...
Read more >
Include null/empty string in OCC Response - SAP Community
@anilKumar You can allow empty arrays with this below property but I couldn't find any direct way to allow nulls without customizing Object ......
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