Skip to content

Commit 43a68dd

Browse files
authored
Update changelogs (#5224)
* moves last unreleasd changes to changeset * gets last version of express cache on demand
1 parent 068887d commit 43a68dd

13 files changed

Lines changed: 101 additions & 46 deletions

File tree

.changeset/frank-horses-sink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apostrophe": minor
3+
---
4+
5+
Restores relative import paths inside Vite-generated entrypoints on \*nix builds so dev server HMR works again, while keeping the Windows-specific absolute path workaround.

.changeset/green-dingos-like.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apostrophe": minor
3+
---
4+
5+
Fixes an issue where the frontend was caching stale choices for `select`, `radio` and `checkboxes`

.changeset/hip-cycles-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apostrophe": minor
3+
---
4+
5+
Bumped dependency on `express-cache-on-demand` to guarantee installation of recent fixes for edge cases that could share a response between two locales of a single-site project, report errors without a process restart, and correctly handle `res.send('')` with an empty string.

.changeset/pink-hands-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apostrophe": patch
3+
---
4+
5+
When we reach the max in a widget area, the `Add Content` button is now disabled.

.changeset/purple-balloons-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apostrophe": patch
3+
---
4+
5+
Fixes an issue where the frontend was caching stale choices for `select`, `radio` and `checkboxes` fields that were saved but no longer valid (i.e removed from the schema).

.changeset/twelve-paws-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apostrophecms/login-totp": patch
3+
---
4+
5+
Bumbs `eslint-config-apostrophe` to `5`, fixes errors, removes unused dependencies.

packages/apostrophe/CHANGELOG.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
# Changelog
22

3-
## UNRELEASED
4-
5-
### Adds
6-
7-
8-
### Fixes
9-
10-
* Fixes an issue where the frontend was caching stale choices for `select`, `radio` and `checkboxes` fields that were saved but no longer valid (i.e removed from the schema).
11-
* When we reach the max in a widget area, the `Add Content` button is now disabled.
12-
13-
### Changes
14-
15-
* Fixes an issue where the frontend was caching stale choices for `select`, `radio` and `checkboxes`
16-
fields that were saved but no longer valid (i.e removed from the schema).
17-
* Bumped dependency on `express-cache-on-demand` to guarantee installation of recent fixes for edge cases that could share a response between two locales of a single-site project, report errors without a process restart, and correctly handle `res.send('')` with an empty string.
18-
* Restores relative import paths inside Vite-generated entrypoints on *nix builds so dev server HMR works again, while keeping the Windows-specific absolute path workaround.
19-
203
## 4.24.1 (2025-12-04)
214

225
### Fixes

packages/event/CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Changelog
22

3-
## UNRELEASED
4-
5-
### Changes
6-
7-
* Removes circle ci, adds github actions.
8-
93
## 1.0.2 (2024-09-05)
104

115
### Adds
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
## 1.0.4 (2025-12-01)
4+
5+
* Default hash function now distinguishes requests by hostname, and respects `req.originalUrl` in preference to `req.url` if available (ApostropheCMS).
6+
* Passing the empty string to `res.send()` no longer causes a failure.
7+
* If `express-cache-on-demand` does fail due to an unsupported way of ending a response, just issue a 500 error and log a useful message. Don't terminate the process.
8+
9+
## 1.0.3 (2022-02-18)
10+
11+
* eslint fixes
12+
13+
## 1.0.2 (2017-11-17)
14+
15+
* Supports getHeader
16+
17+
## 1.0.1 (2016-10-07)
18+
19+
* Modern dependencies
20+
21+
## 1.0.0 (2016-10-17)
22+
23+
* First stable release. Status code support in `res.redirect`, thanks to Alexey Astafiev

packages/express-cache-on-demand/index.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ function expressCacheOnDemand(hasher = expressHasher) {
1515
_.each(_res.headers || {}, (val, key) => {
1616
res.setHeader(key, val);
1717
});
18-
if (_res.redirect) {
18+
if (_res.redirect != null) {
1919
return res.redirect(_res.redirectStatus, _res.redirect);
2020
}
21-
if (_res.body) {
21+
if (_res.body != null) {
2222
return res.send(_res.body);
2323
}
24-
if (_res.raw) {
24+
if (_res.raw != null) {
2525
return res.end(_res.raw);
2626
}
27+
2728
// We know about ending a request with one of
2829
// the above three methods. Anything else doesn't
2930
// make sense with this middleware
3031

31-
console.log('Attempted Request URL: ' + req.url);
32-
throw 'cacheOnDemand.middleware does not know how to deliver this response, use the middleware only with routes that end with res.redirect, res.send or res.end';
32+
console.error(
33+
`cacheOnDemand.middleware does not know how to deliver a response for ${req.originalUrl || req.url},\n` +
34+
'use the middleware only with routes that end with res.redirect, res.send or res.end'
35+
);
36+
// Report the bad news, but don't take the entire process down
37+
return res.status(500).send('error');
3338
});
3439
};
3540

@@ -131,6 +136,10 @@ function expressHasher(req) {
131136
return false;
132137
}
133138
});
134-
135-
return !safe ? safe : req.url;
139+
if (!safe) {
140+
return false;
141+
}
142+
// Create a key that distinguishes requests by hostname, and respect req.originalUrl
143+
// if available (ApostropheCMS)
144+
return `${req.hostname}:${req.originalUrl || req.url}`;
136145
}

0 commit comments

Comments
 (0)