Web Excursions 2021-06-04
Passport – Stratechery by Ben Thompson
the user is viewing subscriber-only content within their podcast player, despite the fact they never previously logged-in within that webview;
that is because every link is unique to that user,
every communication, from podcasts to RSS to email, can be customized to the user
Sovereign Creators and Visas
while sovereign countries issue physical passports, sovereign creators (whether they be individuals or publications) issue online passports to website and communications channels that they own.
in the real world visas let you into other countries; in the online world, visas give you access to other sites and services. Stratechery is launching with three real-life examples:
Passport-to-Passport: A Passport-powered site like Stratechery can sell subscriptions to a different Passport-powered sites like Dithering (with permission, of course)
OpenID and Discourse: Passport can serve as a single sign-on authenticator for any service that supports OpenID
OAuth and Spotify
you can now select Spotify from your Delivery Preferences page, from whence you will be able to link your Stratechery account to your Spotify account,
and listen to the Stratechery Podcast in Spotify
[in addition to Stripe's payment, ] Passport could work with in-app purchasing, a publication’s existing subscription management system,
or even other subscription management services.
Passport’s integration is between member management and open communications tools;
everything else attaches via API (including the optional CMS).
Leaky Abstractions – text/plain
In the late 1990s, the Windows Shell and Internet Explorer teams introduced a lot of brilliant and intricate designs that allowed intricate extension of the shell and the browser to handle scenarios beyond what those built by Microsoft itself.
IE: pluggable protocols
Windows Shell: abstract browsing of namespaces, e.g., WebDAV, CAB
The most popular example: ZIP folders extension
First introduced in the Windows 98 Plus Pack and later included with Windows Me+ directly
The timestamp in the module claims it was last updated on Valentine’s Day 1998
[The author was trying to cut and paste files from a ZIP folder and was confused by the long time taken]
After some small reads from the end of the file (where the ZIP file keeps its index), the entire 11 million byte file was being read from disk a single byte at a time
The cause
the character P in ZIP files– it’s the first byte of the ZIP format’s block markers, each of which start with 0x50 0x4B.
the code is reading the file from start to finish looking for a particular block, 16 bytes in size.
Each time it hits a P, it looks at the next 15 bytes to see if they match the desired signature,
and if not, it continues scanning byte-by-byte, looking for the next P
The ZIP Format consists of a series of file records, followed by a list (“Central Directory”) of those file records.
Each file record has its own “local file header” which contains information about the file, including its size, compressed size, and CRC-32; the same data is repeated in the Central Directory.
ZIP format allows the local file headers to omit this data and instead write it as a “trailer” after the compressed data, a capability that is useful when streaming compression
the code is groveling for the Data Descriptor blocks.
after each file is “moved” from the ZIP to the target folder, the ZIP file must be updated to delete the file that was “moved.”
after each file is “moved” from the ZIP to the target folder, the ZIP file must be updated to delete the file that was “moved.”
here’s where the abstraction leaks—
from a user’s point-of-view, copying files out of a ZIP file (then deleting the ZIP) vs. moving the files from a ZIP file seems like it shouldn’t be very different.
Unfortunately, the abstraction fails to fully paper over the reality that deleting from certain ZIP files is an extremely slow operation, while deleting a file from a disk is usually trivial.