Commit Graph
28679 Commits
Author SHA1 Message Date
Miguel Serrano 194de0b457 [web] Update CE/SP footer with copyright notice (#36065)
* [web] Update CE/SP footer with copyright notice

GitOrigin-RevId: b1e650e9512d8497b03ab167b29792b32053e95c
2026-09-17 11:52:58 +00:00
Kristina 00b594a14f [web] block idle connection-restored events (#36425)
GitOrigin-RevId: 74b142f72f7982e6df9e0208965d8372e23afc74
2026-09-17 11:52:55 +00:00
Antoine Clausse 07835f92b3 Merge pull request #36475 from overleaf/revert-36409-ac-remove-subscription-formatters
Revert "[web] Remove SubscriptionFormatters, format subscription dates in the frontend"

GitOrigin-RevId: d4c6bb600f7315c27016a45a8250a61b46de0119
2026-09-17 11:52:51 +00:00
roo hutton c461297b13 Merge pull request #36461 from overleaf/lg-security-sanitize-html-root
[Security upgrade] bump sanitize-html to 2.17.6 in yarn.lock

GitOrigin-RevId: 2a4629fca9d0c95cad7b0e993433ffcdb0f2b99c
2026-09-17 11:52:48 +00:00
Antoine Clausse ba4f024f34 [web] Remove SubscriptionFormatters, format subscription dates in the frontend (#36409)
* [web] Remove SubscriptionFormatters, format subscription dates in the frontend

Replace the server-formatted nextPaymentDueAt/nextPaymentDueDate/
trialEndsAtFormatted fields with the raw periodEnd date and format in
the React dashboard (same strings as before, English + UTC). Also
consolidate hand-rolled trial checks onto isInFreeTrial /
SubscriptionHelper.isInTrial.

* [web] Remove the now-unused dateformat dependency

* [web] Address review: payment-dates unit test, UTC dates in acceptance test

Add a dedicated unit test asserting the exact formatted strings from
formatPaymentDate/formatPaymentDateTime, and use explicit UTC timestamps
in the SubscriptionDashboard acceptance fixtures instead of
local-timezone Date constructors.

GitOrigin-RevId: 16ac4f1098b14ef9f1478d22cf39c1357ead7dea
2026-09-17 11:52:44 +00:00
Lucie GermainandClaude Sonnet 5 d0399bd09f bump nanoid in yarn.lock (#36457)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
GitOrigin-RevId: 5270797e8c3a3037d39e22c8ff83abf0704bba00
2026-09-17 11:52:33 +00:00
Malik Glossop 15bc30b596 Merge pull request #36140 from overleaf/mg-ai-usage-limit-show
Add 'ai-usage-limit-show' event for ai limits

GitOrigin-RevId: 887ecc8b3fea52bcd45cf771ab0d22b8f4539308
2026-09-17 11:52:30 +00:00
Jakob Ackermann 2566455740 [web] mock the changes/users request in EditorProviders (#36435)
GitOrigin-RevId: 5f8f5b9317d089ca52ff17ad1307d58d625709d5
2026-09-17 11:52:22 +00:00
Eric Mc Sween 62e4164269 Merge pull request #36345 from overleaf/em-library-design-review
[web] Library design review fixes

GitOrigin-RevId: dfd1846d275eb975906a2fe8a8c4dee057c51d1f
2026-09-17 11:52:11 +00:00
Antoine Clausse 1daed4efe4 [web] Add cancel-loss-messaging split test (#36363)
* [web] Add cancel-loss-messaging split test

Populate the cancel confirmation step with plan-specific losses when the
cancel-loss-messaging split test is enabled: "Are you sure you want to
cancel?" heading, the subscription end date, and a card listing what the
user loses moving to the Free plan (compile timeout, AI, collaborators,
history), with the lost benefit struck through next to its Free-plan
replacement.

Shown only to non-trial Student/Standard/Pro individual subscribers with
no other retention offer (trial extension or downgrade upsell) — those
keep the existing confirmation.

Copy matches the mockups in the ticket. No new analytics events; the
existing subscription-page-cancel-button-click / subscription-cancelled
funnel is used.

Part of #35765

* [web] Consolidate ActiveSubscription stories, add cancel confirmation story

Replace the 13 fixture-per-story exports with a single Dashboard story
driven by controls (subscription fixture select, flexible licensing,
cancel-loss-messaging variant), using the CSF factories pattern. Add a
CancelConfirmation story that renders the cancel confirmation step
directly so the cancel-loss-messaging variant can be previewed without
clicking through, with a Professional fixture available to see the Pro
loss rows.

* [web] Use withSplitTests for the ActiveSubscription stories

Register cancel-loss-messaging in defaultSplitTestsArgTypes and drive the
stories' variant from the shared withSplitTests decorator (radio control,
SplitTestContext provided from args) instead of hand-rolled meta tags and
SplitTestProvider. Generalize withSplitTests' typing so it composes with
CSF factories (preview.meta) as well as legacy meta objects.

* [web] Fix Storybook indexing of the ActiveSubscription stories

Storybook's static CSF indexer requires preview.meta() to receive an
object literal, so spread withSplitTests' argTypes/decorators into the
meta literal instead of wrapping the whole config in the helper call.

* [web] Compose ActiveSubscription stories from orthogonal controls

- Wrap the stories in #subscription-dashboard-root so the dashboard's
  scoped styles (e.g. the cancel-loss strikethrough) apply in Storybook
- Replace the single fixture dropdown with independent controls (group,
  plan, period, currency, trial, status, pending plan change, add-ons,
  coupons, pending license change), building the subscription from the
  fixtures' base + patches
- Guard impossible mixes with argTypes `if` conditions: individual-only
  controls hide when group is on, and pendingLicenseChange only shows
  for groups

* [web] Add student plan to the ActiveSubscription story controls

The cancel-loss-messaging variant has student-specific rows (AI
Assistant / 10 collaborators), so the plan control needs a student
option. Groups have no student plans, so for group subscriptions the
student choice maps to the Standard group fixture.

* [web] Provide ol-plans in the ActiveSubscription stories

The cancel confirmation's downgrade branch (monthly Standard is
isEligibleForDowngradeUpsell) looks up paid-personal in ol-plans and
spins forever when the meta tag is missing. Provide ol-plans and
ol-groupPlans from the fixtures, matching the test render helper.

GitOrigin-RevId: e8491c8d39ed059e42ea3442e8d70c3ef304b009
2026-09-17 11:52:02 +00:00
roo hutton dac6254831 Merge pull request #36320 from overleaf/rh-cio-split-tests
[web] require admin opt-in for split test assignments sent to customer.io

GitOrigin-RevId: 5a6f5c3726f3b65c2f432ab20720e6f8f5c53eb1
2026-09-17 11:51:56 +00:00
Brian Gough 3e8f2ebe31 update zod safePath validation to match existing behaviour in web (#36357)
* update zod safePath validation to match existing behaviour in web

* test SafePath from web against zod validation

GitOrigin-RevId: a159f5078b5bf75eac4365c97e34e21e716290eb
2026-09-17 11:51:30 +00:00
Lucie GermainandClaude Opus 5 9cf4fa8bf5 [web] gracefully handle failed oauth token exchange for reference managers (#36377)
* [web] gracefully handle failed oauth token exchange for reference managers

Mendeley/ReadCube redirect back to /:ref_provider/oauth/token-exchange with
`error` and `error_description` instead of `code` when a user declines consent.
completeAuth forwarded the whole query string on to third-party-references,
whose strict zod schema (d8c1679bb08) accepts only oauth_token, oauth_verifier
and code, so the exchange failed and the user got a 500.

The same forwarding also sent `state` on every callback, success or failure.
`state` is web's own CSRF token and is never read by third-party-references, so
it tripped the log-only schema on every single token exchange, and would have
broken linking outright under REQ_VALIDATION_MODE=enforce.

Forward only the credentials the exchange needs, and show a translated
notification in the Reference managers section rather than erroring. Validate
ref_provider against the known providers so the provider name can be
interpolated into the message without reflecting a URL segment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* [web] fix providerName argument and validate before deriving refProvider

Address Copilot review on #36377:

- The token-exchange failure handler passed `false` positionally into the
  `providerName` slot of _redirectWithLinkingError, so a failed exchange would
  have rendered "your false account". Pass providerName and an explicit false.
- _getRefProviderBackendKey(req) ran before parseReq, so refProvider was derived
  from raw, unvalidated req.params. Parse first and derive from the validated
  params via _toRefProviderBackendKey; _getRefProviderBackendKey now delegates
  to it so the other handlers are unchanged.

The completeAuth tests kept their assertions inside ctx.res.callback without
awaiting the controller, so the callback fired after the test had already
returned and the assertions were never enforced — which is why the suite was
green with the providerName bug in it. Await the controller and assert inline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* [web] add logOnly to the completeAuth schema and guard the provider lookup

logOnly returns the raw input on a schema failure, so ref_provider can be an
arbitrary URL segment. Check it against the display-name table rather than
trusting the schema: unknown providers 404 in both validation modes, and
providerName is guaranteed non-null for the rest of the handler.

Also covers the schema half under REQ_VALIDATION_MODE=enforce, so dropping
ref_provider from completeAuthSchema fails a test rather than passing unnoticed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitOrigin-RevId: b98eb5414fe8b672f44aab8c3690f7637d434cd2
2026-09-17 11:51:27 +00:00
Rebeka Dekany 6e57b24811 Record a metric for Stripe API request statuses to monitor rate limiting (#35779)
* Record a metric for Stripe API request statuses to monitor rate limiting

* Add on() stub to Stripe mock in StripeClient unit tests

* Record the Stripe rate-limit reason for 429 responses

* Add acceptance test for Stripe rate-limit reason metric

GitOrigin-RevId: 1674b389f5a7fee403f980b6e813a3e2df81063c
2026-09-17 11:51:23 +00:00
Olzhas Askar b4880f691e Merge pull request #36346 from overleaf/oa-fix-counts
[web] Fix counts

GitOrigin-RevId: b1ec87eb19d41c897b205d2ff178ab2b600fb987
2026-09-17 11:51:17 +00:00
Andrew Rumble 66355e4372 Merge pull request #36361 from overleaf/ar-fix-postdoc-validation-errors
[docstore][document-updater] fix POST doc validation errors

GitOrigin-RevId: 9b5fbc667a3b56b30077ea8de9d81c17253db273
2026-09-17 11:51:12 +00:00
Alf EatonandClaude Opus 4.8 98842d4659 Add Draw mode to the symbol palette (#34868)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
GitOrigin-RevId: 4ea4f97023e65fdb8b018f610f77d7dd107c8e76
2026-09-17 11:51:03 +00:00
Alf EatonandClaude Fable 5 10f10ca95f Only show "Jump to command definition" for right-click on command name (#36191)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
GitOrigin-RevId: 05811783a327fb641f6c677eaa1efeb8a87668fc
2026-09-17 11:50:57 +00:00
roo hutton 1681343782 Merge pull request #36024 from overleaf/rh-cio-group-support
Enable customer.io in-app messages on group management pages

GitOrigin-RevId: 0c30c4ccf219cdbc4dd48ea6940cc46a4c6964c3
2026-09-17 11:50:54 +00:00
Kristina c628d82f07 [web] rm 30s filter for connection-restored events (#36315)
* rm 30s filter for `connection-restored` events
* rm unnecessary lastOutageRef
* stop sending idle events

GitOrigin-RevId: 6ff228c878496ad25bc8cc4c1acb4da5a88dce15
2026-09-17 11:50:51 +00:00
Jakob Ackermann 975cf90357 [editor-core] gracefully handle any legacy v1 import agent (#36354)
GitOrigin-RevId: 186afa70c03e69b3288af66d85a0a3e431780d14
2026-09-17 11:50:47 +00:00
Mathias Jakobsen f7de42f1d3 Merge pull request #36181 from overleaf/mj-offline-mode-feature
[web] Add offline mode to feature set

GitOrigin-RevId: 93d2ed373af5b46f5ead924c14605775826c46e3
2026-09-17 11:50:44 +00:00
Malik Glossop 42feabe643 Merge pull request #35907 from overleaf/mg-ai-usage-event
Fire a 'ai-usage-limit-reached' event in backend

GitOrigin-RevId: b43babdd2a0146086cee5ebd2bde83f8daaf1bb5
2026-09-17 11:50:38 +00:00
Malik Glossop e567abe71a Merge pull request #36105 from overleaf/mg-focus-floating-menu
Hide floating menu and comment context menu item in focus mode

GitOrigin-RevId: 4cc55f5cebae5e88ea1d1c03a9ac270e43c3073e
2026-09-17 11:50:35 +00:00
Olzhas Askar f513b1aa52 Merge pull request #36302 from overleaf/oa-teardown-trial-ineligible-cta
[web] Teardown trial ineligible cta

GitOrigin-RevId: 4d114943bc2839b29b6eae3a133d6c235f98ffcc
2026-09-17 11:50:24 +00:00
Olzhas Askar 58d76ff1a0 Merge pull request #36247 from overleaf/oa-wider-panel
[web] Wider checkout panel

GitOrigin-RevId: ea9edafa4e11b0b04d5a74c664781c3dd0cc5e87
2026-09-17 11:50:20 +00:00
Maria Florencia Besteiro Gonzalez 6b7a77b4b2 Merge pull request #36239 from overleaf/mfb-show-duplicate-in-visual-bib-editor
Show duplicate entries in visual bib editor

GitOrigin-RevId: 32e4e41a751624a2142c7fd2c5e5de5a5d3905f5
2026-09-17 11:50:14 +00:00
Andrew Rumble d43b9d12ba Merge pull request #36071 from overleaf/ar-node-24.18.1
[monorepo] upgrade node to 24.18.1

GitOrigin-RevId: f6857b443d3e7882567d3cb62fa884dce2368191
2026-09-17 11:50:11 +00:00
roo hutton ba589211ea Merge pull request #36314 from overleaf/revert-36194-rh-cio-split-tests
Revert "[web] send active split test assignments to customer.io"

GitOrigin-RevId: c3acb504be2ef003d6a103568ece3175f787e6d5
2026-09-17 11:50:08 +00:00
roo hutton 6b69ea7dc1 Merge pull request #36194 from overleaf/rh-cio-split-tests
[web] send active split test assignments to customer.io

GitOrigin-RevId: 3036d6442e8419326f4b641482d65bd5114fe3da
2026-09-17 11:49:59 +00:00
Brian Gough df7a9159c2 normalise image counts in compile-with-optimizable-pngs analytics events (#36308)
GitOrigin-RevId: 6049161196fab1b2e4c3d9aa811b97e3e529aca2
2026-09-17 11:49:54 +00:00
Tom Wells 88fb4c48b2 Merge pull request #36290 from overleaf/copilot/update-library-empty-state-illustration
Update library items for better guidance

GitOrigin-RevId: 15f60589f721a8243110dda58ef7b1134e2c5275
2026-09-17 11:49:50 +00:00
Antoine ClausseandMathias Jakobsen 87fd22cefc [web] Fix negative AI quota countdown after reset period elapses (#35690)
* Fix negative AI quota countdown after reset period elapses

Backend (`FeatureUsageRateLimiter`, `TokenUsageRateLimiter`): once the
24h period had lapsed, `remainingUsage`/`remainingTokens` reset to the
full allowance but `resetDate` kept pointing at the old `periodStart +
24h` (i.e. in the past). Advance to `now + 24h` in that case.

Frontend (`NewPlanPaywall`, `ErrorGetPremium`): the "wait X hours and Y
minutes" copy computed `restoreTime - now` without clamping, so a past
`restoreTime` produced negative hours/minutes (users saw "wait -118
hours and -35 minutes"). Clamp to 0.

* Address PR review on quota reset fix

- Keep `resetDate` tied to the stored `periodStart + PERIOD` rather
  than jumping to `now + PERIOD` when the period has lapsed. The
  moving-target variant unnecessarily reinterpreted a stable field
  (existing consumers such as `use-ai-access-gate` check whether the
  reset date is in the past).
- Clamp `remainingUsage` / `remainingTokens` at 0 so a concurrent
  over-usage never leaks a negative count.
- Align the boundary check with `_checkRateLimit` / `checkUsage`
  (inclusive `<=`).
- Cover the period boundary and the clamp in unit tests for both
  `FeatureUsageRateLimiter` and `WorkbenchRateLimiter`.

* Truncate test fixtures to whole seconds

`resetDate` is serialized with `Date.toString()`, which has second
resolution, so fixtures with a millisecond component failed the
boundary assertions.

* Revert code changes; keep tests that document the bug

The fixes masked the symptom (negative countdown) without addressing
the underlying issue, and it is not fully understood yet. Revert the
rate limiters and the writefull paywall components to their original
behaviour, and instead pin the current behaviour in tests:

- `it.fails` tests document that `remainingUsage`/`remainingTokens`
  go negative when usage exceeds the allowance — these flip red when
  the bug is fixed, at which point they should become plain `it`.
- The lapsed-period tests assert (with explanatory comments) that
  `resetDate` keeps pointing at the end of the lapsed period, which is
  the server-side ingredient of the negative-countdown support ticket.

* Reapply quota fixes

Restores the post-review state of the rate limiters (clamp remaining
counts at 0, inclusive period boundary, resetDate tied to periodStart)
and the writefull paywall components (clamp countdown at 0).

Tests intentionally untouched in this commit; the two `it.fails` tests
now need flipping to plain `it` in a follow-up.

* Flip bug-documenting tests to plain assertions

The clamp fixes are reapplied, so the `it.fails` tests now assert the
fixed behaviour directly. Trim the explanatory comments.

* Set resetDate to `Date.now() + PERIOD_IN_MILLISECONDS` instead of the expired/stale date.

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>

* Update lapsed-period tests for the fresh resetDate

`resetDate` is now `Date.now() + PERIOD` once the period has lapsed, so
assert an approximately-fresh date instead of the stale period end.

---------

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>
GitOrigin-RevId: ad39627ab9e5ceccb2a61443b2b7d39c68600594
2026-09-17 11:49:47 +00:00
Brian Gough 6b3d95cea4 add optimisable png count and compile stats to compile-with-optimizable-pngs event (#36279)
* add count of optimisable pngs to HistoryResourceWriter

* add optimisable png count and compile stats to compile-with-optimizable-pngs event

GitOrigin-RevId: 5c528d727473ec2d3082845d8d5b60844f3434f6
2026-09-17 11:49:41 +00:00
Anna Claire Fields b8339c5b4a history-v1: handle ERR_STREAM_PREMATURE_CLOSE in streamZip (#36135)
GitOrigin-RevId: 963b65583da58034afe304206f6e0c66e9186b06
2026-09-17 11:49:33 +00:00
Andrew Rumble d9e7900246 Merge pull request #35553 from overleaf/copilot/fix-split-test-calculator-event-suggestions
Fix split-test calculator event suggestions by scoping event queries and deduping in-flight lookups

GitOrigin-RevId: 2afebbd645218770cb3a8fbd615038df215dd9ed
2026-09-17 11:49:27 +00:00
Mathias Jakobsen 77f208633b Merge pull request #36233 from overleaf/mj-command-palette-events
[web] Add events to command palette usage

GitOrigin-RevId: 1bb40c20f3228027ee4470dc84fa2983bb910cbf
2026-09-17 11:49:19 +00:00
David 3325724a9e Merge pull request #36258 from overleaf/dp-fix-library-badge
Use feature flag config for library badge rather than hard-coding

GitOrigin-RevId: a53bd7c739d2d8e6c5dbd5bda1fbc3a87f87b280
2026-09-17 11:49:12 +00:00
Jakob Ackermann 49969f6e0d [history-v1] adopt strict zod types and extend test coverage (#36089)
GitOrigin-RevId: 7bdffe2c05c7c17be6eb3e4296d8df05d650c53e
2026-09-17 11:49:08 +00:00
roo hutton b886c0b266 Merge pull request #35836 from overleaf/rh-prices-split
[web] Update monthly plan prices for new subscriptions with split test

GitOrigin-RevId: 42d0adaf68647adc93f4c05d5ddeefb356753db2
2026-09-17 11:49:04 +00:00
Kristina 2e1a313ccd [web] resize mentions dropdown styles (#36172)
GitOrigin-RevId: e0f4ff0d51f168569ad54fa896ab25c399278ebb
2026-09-17 11:48:53 +00:00
Kristina c5f3726eda [web] update comment placeholder for mentions (#36167)
GitOrigin-RevId: c702e00004d8dfcf243425503459f558973a657b
2026-09-17 11:48:50 +00:00
Jakob Ackermann 95e3444a6e [editor-core] refine zod schemas for rawTextOperation and rawFileMetadata (#36253)
* [editor-core] gracefully handle no-op TextOperation

* [editor-core] add support for legacy url imports

* [editor-core] reorder rawFileMetadata entries

GitOrigin-RevId: f5c3158def00183d4a60a5b934abd921716e2339
2026-09-17 11:48:47 +00:00
Jakob Ackermann b4937905bb [linked-url-proxy] adopt strict zod types and extend test coverage (#36166)
GitOrigin-RevId: 1edbd4ea3240cc8973d0a7e6488a8b882422a42b
2026-09-17 11:48:43 +00:00
Jakob Ackermann 2e8f6f0d03 [chat] adopt strict zod types (#36102)
GitOrigin-RevId: eb3e245599f5db2d29366ce5d8e0993ec6b20338
2026-09-17 11:48:40 +00:00
Jakob Ackermann 4e79741e78 [latexqc] integrate latexqc closer into build scripts (#36252)
* [monorepo] drop unused --docker-repos build script flag

* [latexqc] integrate latexqc closer into build scripts

- Generate Dockerfile
- Drop now unused --only-jenkins-include-file

* [monorepo] update header for custom Dockerfiles in build scripts

GitOrigin-RevId: 84d0b100e731ae41db132f676e7837e17c17542e
2026-09-17 11:48:37 +00:00
Jakob Ackermann 4e6e98941a [latexqc] adopt strict zod types and extend test coverage (#36165)
GitOrigin-RevId: 339aa5c5b51dc2ab97178e482142f64d7324a57b
2026-09-17 11:48:33 +00:00
Jakob Ackermann a80f9d4803 [github-sync] adopt strict zod types and extend test coverage (#36050)
GitOrigin-RevId: cd4060778455e9bc252588e449d5588852648592
2026-09-17 11:48:27 +00:00
Jakob Ackermann 6ca58edf72 [web] add infrastructure level zod change (#36190)
* [web] add infrastructure level zod change

* [web] set req validation mode for tests to 'enforce'

GitOrigin-RevId: 6dbc8bff7ed9f89045c398df93d84bca589de4e9
2026-09-17 11:48:19 +00:00
Antoine Clausse 86bab9dc99 Merge pull request #35724 from overleaf/ac-wallet-payment-method-analytics
[web] Add Stripe wallet payments (Apple Pay / Google Pay) in analytics and remove conversion to "card"

GitOrigin-RevId: f6d404d35eb108d7ddaf8ca1b6c2164cb5100c9c
2026-09-17 11:48:15 +00:00