# Strapi production notes

## DEP0170: "The URL api::property.property?page=1&pageSize=10&sort=slug:ASC is invalid"

This is a **Node.js deprecation warning** (not a Strapi bug in this project). It is emitted when something passes a string that looks like a URL but is not a valid HTTP URL (here: the content-type UID `api::property.property` with query params) to Node’s URL parser (e.g. `new URL()` or `fetch()`).

- **Likely source:** Strapi core (Document Service or REST layer) when handling requests to `/api/properties` with query params. The content-type UID is sometimes used as a path/identifier and may be passed where a full URL is expected.
- **Impact:** Warning only; the request still works. Future Node versions may throw instead of warning.
- **What you can do:**
  - Ensure `FRONTEND_URL` in Strapi `.env` is a valid `http://` or `https://` URL (revalidate uses it; invalid values are now rejected in code).
  - Upgrade Strapi when a fix is released.
  - Optionally suppress the warning: `NODE_OPTIONS='--no-deprecation'` (only if you accept hiding other deprecations).

## ECONNRESET

`read ECONNRESET` usually means the other side closed the TCP connection (e.g. proxy, Next.js revalidate endpoint, or database).

- **Revalidate:** Strapi calls Next.js `/api/revalidate`. If Next.js restarts, times out, or the proxy closes the connection, Strapi can see ECONNRESET. Revalidate now validates `FRONTEND_URL`, uses a 10s timeout, and retries up to 2 times on connection errors.
- **Database:** Postgres pool settings were updated (`idleTimeoutMillis`, `connectionTimeoutMillis`) so connections are less likely to be reused after the server has closed them. Tune `DATABASE_POOL_*` and `DATABASE_CONNECTION_TIMEOUT` in `.env` if you still see DB-related resets.
- **Proxy:** If Strapi is behind Apache/Nginx, ensure proxy timeouts and keep-alive are sufficient so the proxy doesn’t close connections during long requests.

## Meilisearch and property lifecycles

Property create/update/delete lifecycles now:

1. Sync the property to Meilisearch (or remove it on delete).
2. Call revalidate for `properties`, `home-page`, and `header`.

So the search index stays in sync with Strapi without a separate cron. Ensure `MEILISEARCH_HOST` and `MEILISEARCH_MASTER_KEY` are set if you use Meilisearch.
