In the Observable 1.0 notebook below an attached image file is displayed correctly within the page:
https://observablehq.com/d/5018f0019653b48b
This is the case whether viewing the page while logged in, and also if not (e.g. via an incognito browser session).
In the Observable 2.0, the file attachment only appears when logged in. If I view it via an incognito session, there is no file attachment and an associated file not found error:
https://observablehq.com/d/48da8a2f4918a7da
Possibly related: If one notebook generates a constant that is dependent on an attached file in that notebook, trying to import that constant from another page results in a file not found error. This occurs whether or not logged in to Observable.
In practice, this is breaking quite a few of my notebooks in 2.0 that previously worked in 1.0.
For some reason, your file attachment (bloom.png) was not published when you made your notebook unlisted. Therefore it is not visible when signed out. You may be able to fix this by making the notebook private and then making it unlisted again, which should republish the file.
That said, I can’t explain why the file attachment was not published when you made the notebook unlisted, since making the notebook unlisted and marking the file as public would normally happen in the same transaction (so if we didn’t succeed in making the file public, the notebook wouldn’t become unlisted, either).
(The file contents are indeed public, but files are content-addressed so that can simply be because another notebook made a file with the same contents public.)
Is it possible that your changes weren’t fully saved when you made the notebook unlisted? If the file is still uploading when you make the notebook unlisted or public that could cause an issue… we should probably disable those buttons until all changes are saved.
Edit: I was able to reproduce this error by making a notebook unlisted before the file attachment was saved to the notebook, so that’s my guess as to what happened here.
Thanks for the tips.
I think the original unexplained mismatch between publication of the notebook and its attached file was because it was made unlisted (published) via the 1.0 interface. To check I tried making private and unlisted again via 1.0 and the problem persisted. When I republished via the 2.0 interface, it worked.
Hopefully this kind of problem will be temporary while We / I are hopping between 1.0 and 2.0 before more 1.0 functionality is transferred to the 2.0 interface. But may be worth noting this kind of problem can occur while the old and new file attachment processes exist in parallel.
I can also confirm this was the cause of my other problem in not being able to ref to an attachment-related constant in another notebook. Private/publish via the 2.0 interface fixed the problem.
Ah ha, thanks for the context. Yes, Old Observable has a much more rudimentary treatment for files, so I would not recommend using it to republish New notebooks. This is all related to New Observable’s new ability to track file attachments in version history, whereas Old Observable could only accumulate new files under new names, leading to messes.