Unreleased [Not released yet]
Part 5 of 15. Previous part
Fixed (612)
- A
script-src-elemthat the app names inwisp::cspgets the hashes of the inline scripts, the asset host and the nonce, asscript-srcdoes. Before, it got none, so the browser blocked the inline scripts of the app with no message. Ascript-srcorscript-src-elemwith'unsafe-inline'(in any case:'UNSAFE-INLINE'too) still gets no hash or nonce, because one would turn'unsafe-inline'off. A source that the directive has already, such as a hash that the app names, is not added again. The server build now logs a line that names that directive at start. The edge build does not, for its size. wisp checkno longer warnsjs-unused-importfor an import that the file reads only as a store, such as$account.user. A$nameis a use ofname, as the browser reads it. A$namein a string or in the text of a template literal of a script is still no use.- First paint: the server now computes
a ? b : cas an item of an array or a value of an object, such asclass={:['a', on ? 'b' : 'c']}. Before, it wrote noclassthere, and the page kept the element hidden until the browser bound it. - First paint: in
<b class={:c} {:...rest}>, aclassinrestwins overc, as in the browser. Before, the server wroteclasstwice, and the browser used the first one. A spread beforeclass={:c}does not writeclass. - First paint: a component that the browser draws gets its
...restfrom the server too. Before, the server wrote none of its extra attributes, such aspopovertarget. A value that the server does not know stays out, and the browser sets it. - HTTP/2 on a 32-bit target: the owe deadline counts with no wrap the bytes sent since the connection began to owe. Before, a
usizecast cut the count past 4 GiB, so the deadline could come too early. - HTTP/2: DATA that comes in the same read as a WebSocket's extended CONNECT goes to the socket, in order. Before, the server gave it to the GET as its body, and the socket did not get it.
since_mark,before_mark_from,take_since_markandmove_before_markof the response headers no longer slice past the end of the list aftersendempties it. No caller did this, so no page changed./_wisp/healthhas a test for its 503 answer.- A chunk line is a 400 when a control byte other than tab is in its extension (
1;a<NUL>b), or when a byte other than a space or a tab is between the size and its;(a form feed). Before, such a line passed, and a proxy in front may frame it in another way. - The 304 for
/_app/wisp.jsand/_app/live.jssaysvary: accept-encoding, as the 200 does. Before, it had novary. - An error goes back as JSON or as a page by the order of
jsonandtext/htmlinAccept, with the media types in any case. Before,Application/JSON, text/htmlgot a page andTEXT/HTML, application/jsongot JSON. - An answer to HEAD with the status 204 or 304 has no
content-length, and one with 205 hascontent-length: 0once, on HTTP/1.1 and HTTP/2 and throughhandle. Before, thecontent-lengthof the app stayed on it, so a 205 had two on the wire. handleruns the app setup once, not at each request. Before, an app with more than 256 locales logged the line "locales" at each request.WISP_MAX_CONNSset to a number over the open-file limit no longer makes the server hang its clients on Linux. Before, a set number skipped the raise of the soft open-file limit. Clients waited with no 503 on epoll and io_uring. On epoll, accept failed withEMFILE. On io_uring, accept may fail the same way. Now the server raises the soft limit to the hard one at start on every set or unset value. It keeps the number at most half of a limit of 2048 or less, else at most the limit less 1024 (64 at least). It writes a note when it cuts a number of 1 or more.WISP_MAX_CONNS=0is cut the same way, with no note. Test:tests/app/tests/linux.rs, both drivers.- With TLS in the server (the
tlsfeature), aSecurecookie logs nowisp: sent a Secure cookie on a request with no sign of HTTPSline. Before, a request with nox-forwarded-prototo aHostthat is not this machine logged it once. A panic in the TLS certificate reload check writes onlywisp: TLS certificate reload failed, the old one is still served: <reason>, once, unlessRUST_BACKTRACEhas a value. Before, the panic hook also wrotethread 'wisp-tls-reload' panicked at ...for each panic. - A page of an
upstashstore shows each name once. Before, a SCAN reply that named a key twice gave the name twice. The same name may still show on another page, because RedisSCANmay repeat a key. - Each driver words an unknown operation as
KIND NAME (DRIVER): no such operation: X, for exampleblob B (s3): no such operation: nope. Before,fs,memory,s3,vercel-blob,libsqlandd1-httpgave onlyno such operation: X, and onlyupstashnamed the store. - A panic in the parse of a gzip request body no longer leaves a flag set on the worker thread. Before, later gzip bodies on that thread stayed packed for the handler. A form larger than 64 KiB, sent to a route that takes an
Upload, also skipped the spool. - A custom element reads a prop of type
Option<&'static str>as text. Before, it read the attribute as JSON. - OpenTelemetry: the exporter thread logs the count of spans that the full queue had no room for. It logs it at most once a minute, also when the collector takes each batch. Before, it logged the count only after a POST failed. So with a working collector, a full queue dropped spans and logged nothing.
- Wisp reads an upload as a ZIP64 Office file too: the end record with
0xFFFFFFFFfields points to the ZIP64 record. Before, such a file stayedapplication/zip. A text file withftypat byte 4 wasvideo/mp4, and with theavifbrand it wasimage/avif. Now anftypbox needs a size from 16 to0xFFFFFF. The docs say1 MiB, as the code does, in place of1 MB. - An upload that starts with
<svgfoo>,<a:svgx>or<!DOCTYPE svgx>wasimage/svg+xml. Now the namesvgmust end at a space,>or/. A Unicode space before the root element no longer counts: only the four spaces of XML do. The SVG test of a text file over 1 MiB used the first read, which can be short. It now uses a full first chunk. The 1 MiB limit for JSON and CSV now holds when the caller gives a length that is too low. wisp upgraderuns no barecargo updatewhenCargo.locknames no Wisp crate. Wisp skips it and says so.wisp upgradeupdates a lock that names onlywisp. Before, it ran a barecargo updatefor every dependency.wisp upgradechanges the tag in--tag=<old>of the deploy workflow. Before, it left that line as it was.wisp upgradedoes not change a path dependency that hasgitin its path. Before, it rewrote the line.- A failed
wisp upgrade --undoor--force-undonames the files that it already put back. It also deletes its temp file. - A form to a route that takes an
Uploadis a 400 when it ends before its closing delimiter, also when the body is whole in memory (a form of 64 KiB or less, or one that came with its head in one read). Before, it gave 200 with the fields and no file when the last part had no end. A form that streams was a 400 already. A multipart form with no boundary in its body is a 400 too. A form of another type is not changed. - The error for a bad
#[collection("..")]name says that the name starts with a lowercase letter. Before, it named only lowercase letters, digits and_, so_postsfailed with no reason. wisp route add <path> crudwritessrc/db.rsto a temp file and renames it over the old file. Before, it truncated the file and then wrote it, so a failed write may leave the file empty. The command now also adds only what the file lacks:struct Postwith noPOSTS, orPOSTSwith noPost. Before, it added nothing in the first case and a secondPOSTSin the second.wisp devshows the error when proxy rules exist and it cannot read the routes for their check (a+server.rsthat is not UTF-8, for example). Before, it took the routes for none and said nothing.wisp route add <path> restnames its type aswisp route add <path> cruddoes:/api/categoriesgivesCategory(before:Categorie), and a name of the prelude, such as/api/pages, givesPageRow. A name that starts with a dot, such as/.well-known, gives the page titleWell Known(before:.well Known).- The text of
wisp route addis plainer. Theformscaffold flashesReceived from {name}. Reply to {email}.(before: one sentence with a semicolon). The error for a bad folder name lists.and=, which the command allows, and the error for a folder likex.baksays that Wisp never serves the route. wisp preview --staticrefuses the Windows device namesCOM0,LPT0,CONIN$andCONOUT$with 400. Before, it served them. The names ofwisp new,wisp routes crudandwisp routes componentrefusecom0,lpt0,conin$andconout$too. The CLI and the runtime now use one list (wisp_shared::winname::windows_device).- A
+server.rsthat is not UTF-8 fails the build with its path. Before, the build read it as empty, and the route had no endpoints. - In an app script, a vertical tab (U+000B) is white space. Before, the build read it as a symbol.
- In an app script, the flags of a regex end at white space. Before, a no-break space after
/a/gbecame part of the regex token. - A label after a brace (
{ foo: for (;;) { break foo } }) is no longer read as an object key. Before, the mangle pass of the runtime's own browser files renamedbreak fooand not the label, when afoowas declared in the file. - In an app script, the check for a write to a name no longer climbs through every block around it. A
{after;,{,},),=>,else,try,finallyordois a block, not a pattern. With deeply nested blocks, the build work now grows in step with the size, not with its square. 1,000 nested blocks read token text 1,104,027 times, 4,000 read it 16,416,027 times. Now 104,029 and 416,029. Source: the testbig_scripts_compile_in_linear_time, counts before and after the fix. - In an app script, a call with a block on the next line (
f(n)then{ n = 1 }) is no longer read as a method. Before, the rewrite did not change the$statenamenin both lines. It stayednand notn.v. A method with its{on a new line, in a class or an object, still binds its parameters. - In an app script, a
++or--at a line break follows the rule of a line break. A$derivedname on the line aftern++is a read, and the build no longer fails with "dis$derived". A name before a++that starts the next line is a read too. Before, the build took both for a write. - In an app script,
$state(1,)with a trailing comma gives the first paint the value1. Before, it gave1,. - In an app script, the name of
for (let x of xs) f(x)with no block is local to that one statement. Before, it was local to the rest of the enclosing block. A later read of a globalxwas not a read, and the$staterewrite did not change it. - In an app script, a declaration in a block ends at a line break, as at the top level. After
let a = 1and a new linefoo(), bar(), the namebaris a read and no longer a declared name. - In an app script, a block after
case 1:or a label is a block. Before, a call such asf(x)and a block on the next line were read as a method with the parameterx. - In an app script, the body of an arrow function with no block ends at its last token. Before, a name at the start of the next line was local when it had the name of a parameter.
- In an app script,
class A extends mix(x) {on one line is a class and a call. Before,mix(x)was read as a method with the parameterx. - In an app script, a
let,constorvarinit without a semicolon ends at a line break before{,++or--. Before, the init took the next line, andlet a = 0followed by a line{ x = 1 }becamelet a = __wisp_s(0and{ x = 1 }), which is a syntax error. A line that starts with(,[,+,-,/or a template literal still goes on with the init, as in JavaScript. A{on its own line afterfunction ()orclass Astill opens the body. - In a script, a
$statename that starts a block (L: { n = 1 }, or{ n = 1 }on a new line after a statement) no longer gets a label. Before, the rewrite read the block as an object pattern with a default, and wrote{ n: n.v = 1 }. The code ran the same, but the output was longer. The minifier of the runtime files had the same fault aftercatchandstatic. It is not an app path. - A
has:ormissing:condition of aredirects,rewritesorheadersrule reads the request as sent. A cookie that this request sets (in thebeforehook, a handler or thehtmlhook) does not change a condition of aredirects,rewritesorheadersrule. Before, arewritesrule with a cookie condition also read a cookie that thebeforehook set, when the hook returnedResponse::rewrite. - A REST list with
?sortkeeps only the firstoffset + limitrows that pass, with their sort keys. It does this while it reads the table under its read lock. Before, it kept the sort keys of every row that passed. The testa_sorted_page_holds_the_keys_of_its_page_not_of_every_rowcounts the bytes of the sort buffers on 10,000 rows withlimit=10. It counts 1,280 forsort=aand 6,016 forsort=a,b,c,d. The order of the rows does not change. - A REST sort puts the numbers of a number field before its other values, and reads
NaNas text. Before, a number and a text compared as text, so the order of three values could change with the pair compared. - A REST
PUTwith abefore_updatehook that writes the row is a 409 (conflict), as aPATCHis. Before, thePUTwrote over the hook's write when the type had no#[json(skip)]field. t()in browser code: a<html lang>of__proto__orconstructormade a plural throw aTypeError. An empty=Ncase gave the text of the plural category. A plural with no case for the count and nootherthrew. Now the=Ncase wins also when it is empty. Then come the category andother, else no text, as on the server.- A
MediaQuery,prefersReducedMotiontoo, callsmatchMediaon the first read ofcurrent. Before,reactivity.jscalled it when the module loaded, also for a module that names onlyfromAction. WherematchMediais missing, the load failed. - The build checks the name of
#[collection("name")]with the rule of the macro (a lowercase letter, then lowercase letters, digits and_). Before, the build tookpOstsand_posts, which the macro refuses. - The build reads the first
typeof a<script>for its CSP hash, as a browser does. Before, it read the last. A script withtype=module type=application/jsongot no hash and the CSP blocked it. wisp dev --target <host> --port 0is an error:--port 0 does not go with --target. Before, Wisp passedPORT=0to the host and waited 30 s for a host on port 0.- The error dialog of
wisp devnames the file and line of a template error when the path starts with a Windows drive (C:\app\src\routes\+page.wisp:4:1). Before, it named no place. wisp devcounts a save as a change after a build when a Rust file keeps its size and its time stamp but not its text. Before, it kept the code of the file from before the build.- The Pages warning about
static/entries that reach the worker uses the singular for a count of 1 (1 top-level name,1 entry reaches the worker, which serves it). Before, it said1 top-level namesand1 entries reach. const EARLY_HINTS_H1insrc/hooks.rsor in a+server.rsfails the build, asEARLY_HINTSdoes. Before, the build ignored it there.- The docs of
Browser::evalsaid that a value that is not JSON givesValue::NULL.undefinedgivesValue::NULL, and an object (an element too) gives its own fields. A browser may fail to send some values (for examplewindow). Thenevalfails with the browser's error. For such a statement, usevoid (...)or return JSON (el.id). - On a
CACHEorCACHE_PUBLICroute whose handler callscx.cors, the kept answer holds each header that the handler set, also those beforecx.cors. Withcx.cors("*"), a request with anyorigingets a hit. Whenaccess-control-allow-originechoes an origin, the kept answer holds one origin at a time. A request with the sameorigingets a hit, and alternating origins run the handler again. Before, a hit sent noaccess-control-allow-originand novary: origin. - A plugin
pathreads as each other string of Cargo.toml:'''../k'''and"""../k"""are../k. An empty path is an error that names it. Before, such a path was the app folder, and the error named another cause. - A
[dependencies.kit]table takes the dependency from the workspace only withworkspace = true. Before, any such table took the rename of the workspace'skit, also withworkspace = false. - A release build reads
[lib]and[workspaceonly as table headers of Cargo.toml. Before, the text in a comment or a string made a plain build, or took the folder above as the workspace root. - A cargo child with no output to read is a failed build with the message
Could not read the output of cargo <command>.Before,wisppanicked. wisp::oauth::oidcwith a name that is not a word (my-okta) answers 500 witha provider's name is a word, such as "github", notmy-okta. Before, the handler panicked after the discovery fetch.wisp dev: after a failed build, a save in a layer reaches the app again. The check before the compile now copies the layer in first. Before, it read the broken copy of the failed build, and each later save failed until you copied the files by hand.wisp lspdrops the data of an app when the editor closes the last open file of that app. Before, the server kept the data of each app until it stopped.- After
shutdown,wisp lspanswers each request with the error -32600 (InvalidRequest). The LSP specification asks for this error. Before, the server answered the request. - The colors of
wisp lspkeep the names of a block after a browser text hole such as{:count}. Before, thecharof{#each xs as char}showed as a type after{:count}. wisp lspreads the name of an action attribute as the build does:#[action]and#[wisp::action]mark an action,#[actionx]does not. A comment between#[action]andfnno longer hides the action.- The build reads a
mod NAME;ofmain.rsandlib.rsby tokens, at the top level only. The braces of a macro (cfg_if!) are not a level. The body of a fn or aconstis a level. Amod NAME;in a string literal or in an inline module is not a declaration ofsrc/NAME.rs. Amodwith its name on the next line is one, and so ismod r#NAME;. Before, the build did not compilesrc/NAME.rsfor such a string, and compiled it a second time for such a declaration. - The auto-imports take
lib.rsas the crate root only when its code callsapp!. Before, a comment or a string withapp!inlib.rswas enough. The auto-imports also read amod NAME;in the braces of a macro, but not in amacro_rules!body.