Support new backend contracts: single-flight refresh, ad impression tokens, error handling

- apiFetch: proactive refresh, cross-tab single-flight via Web Locks, no logout on transient errors
- AuthContext: save tokens returned on own login change, revoke refresh on logout, sync tabs
- Ads: X-Session-Id, impressionToken in impression/click, IAB viewability, safe http(s) targetUrl
- STOMP: refresh before CONNECT, stop reconnect loop on dead session, /user/queue/errors behind flag
- Auth form: password 8 chars / 72 bytes; 429/413 messages via describeApiError
- My posts with auth + moderation badges; post form step validation and field limits
- Map: escape user text in Yandex hint/template

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-20 02:03:42 +03:00
parent 67de963d6d
commit db37befb8d
34 changed files with 1005 additions and 260 deletions

View File

@@ -1,4 +1,4 @@
export const API_URL = process.env.REACT_APP_API_URL || "http://localhost:8080";
export const API_URL = process.env.REACT_APP_API_URL || "http://localhost:8080";
export function getImageUrl(filename) {
if (!filename) return null;
@@ -8,3 +8,11 @@ export function getImageUrl(filename) {
}
export const SUPPORT_EMAIL = process.env.REACT_APP_SUPPORT_EMAIL || "support@nakhodka.app";
/**
* Подписка на /user/queue/errors (ошибки отправки сообщений чата: пустое или
* длинное сообщение, нет доступа). Бэкенд до ветки backend-review отклоняет
* эту подписку и закрывает STOMP-соединение, поэтому включается флагом
* REACT_APP_WS_ERROR_QUEUE=true после деплоя нового бэкенда.
*/
export const WS_ERROR_QUEUE_ENABLED = process.env.REACT_APP_WS_ERROR_QUEUE === "true";