Closed Bug 988539 Opened 12 years ago Closed 12 years ago

client-side make details when loading an edit route won't work for "not searchable" makes

Categories

(Webmaker Graveyard :: Thimble, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michiel, Assigned: michiel)

References

Details

Attachments

(1 file)

you can't search for not-searchable makes, so saving a project as "not searchable" will make Thimble ask the makeapi for details and get nothing back. We'll need to make thimble request the makeapi details upon page generation time, so we can nunjucks it into the friendlycode loader.
I rewrote the code to do server-side make loading instead, but searching for makes with the "searchable on webmaker.org" turned off (published = false) still doesn't yield any make details, despite the thimble user being authenticated as the 'owner'.
this could should work, in principle, but a logged in user X, having published a make with "publish:false" to the makeapi, will not get any results back when searching for their make by url. This is despite thimble being hawk-authenticated with the makeapi. The code in this attachment is code that *should* work, but doesn't, can you check whether there is an obviously missing bit here? (auth is set up in lib/makeapi, and the details are grabbed in lib/parameters for the :id parameter)
Attachment #8398792 - Flags: review?(cade)
Summary: client-side make details when loading an edit/remix route won't work for "not searchable" makes → client-side make details when loading an edit route won't work for "not searchable" makes
STR: - load thimble - publish, with a random title, tags, and description, and with "searchable" turned on - reload the page, with the /edit link - republish. the fields should all be correct wrt what you fille in earlier, but this time turn off "searchable". - reload the page, again with the /edit link - republish. the fields are now "Defaults" because no makedetails were found for the make. the node console will show the user's session, make url, and found makedetails in the console. The first two will be actual content, the third will be an empty array when the make is set to published:false in the makeapi. It looks like the makeapi is not letting thimble see not-published makes, even when the correct user is logged in (although the hawk-auth may not have communicated that fact)
Looking at the Make API server logs, it seems that for some reason Thimble is not using the authenticated search route. I suggest updating the client to 0.5.21 and using an unauthenticated instance for other searches and an authenticated one for that searches for finding unpublished makes - unless the only use for searching is authenticated.
Comment on attachment 8398792 [details] [review] https://github.com/mozilla/thimble.webmaker.org/pull/407 proper PR this time. The solution loads make details even on an edit/remix for a non-searchable make, and the checkbox in the publish details pane now also has the right value. unchecking it, saving (or cancelling), and then trying to publish again should now show the checkbox as still unchecked. Conversely, a not-searchable make should have the checkbox state persist during the session instead of resetting to checked.
Attachment #8398792 - Flags: review?(cade) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: