Download Latest Version OpenEstate v0.9.1 -- Cheque Queue Validation Fix source code.zip (2.5 MB)
Home / v0.7.1
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-09-24 4.7 kB
v0.7.1 -- Audit log fix source code.tar.gz 2026-09-24 1.7 MB
v0.7.1 -- Audit log fix source code.zip 2026-09-24 2.2 MB
Totals: 3 Items   4.0 MB 0

v0.7.1 — Audit log fix

Security fix. Read this before you rely on your audit log.

Before v0.7.1, most create, update and delete actions wrote no audit row at all, nearly every row that was written had no user and no IP address, and a failed audit write could report success for a change that was never saved — including in the financial core.

The history that was never recorded can't be recovered. Treat audit history from before v0.7.1 as incomplete, and don't use it to conclude that an action did not happen.

What was wrong

Three separate defects, found while testing something else.

1. Most actions weren't recorded. 53 places in the code that save changes, among them users, applicants and consents, projects, towers and units, brokers and commission rules, GST and TDS rates, letter and SMS templates, custom fields, follow-ups, NOC requests, communications, and receipt reprints, never produced an audit row. Nothing failed and nothing was logged; the row just wasn't written. Admin → Audit Log looked populated because other actions (inquiries, bookings) were being recorded, so the gap was easy to miss.

2. Rows had no actor. Nearly every audit row ever written showed "System" in the User column instead of the person who acted, and had no IP address — bookings and receipts included. You could see that something changed, not who changed it.

3. A failed audit write could fake success. If writing the audit row failed, the database had already abandoned the change, but the API could still answer with success — for example a 201 and an id for a record that was never saved. This could happen anywhere an audited change is made, the financial core included. It's not something we saw in production; we found it by testing.

What's fixed

  • Those 53 actions now write an audit row, with the signed-in user and their IP address, for staff and portal users alike.
  • If an audit row can't be written, the action fails with an error instead of appearing to succeed, and the failure is logged (record type, action and id — never the values).
  • Audit rows no longer depend on a global setting to record money amounts, and secrets are redacted however deeply they're nested.
  • Background jobs and the public inbound-lead API still show "System": no person made those changes.

What's still missing

These are tracked in docs/todo.md, not fixed here:

  • An UPDATE row records the new values only, not the old ones.
  • Some bulk changes write no row — 14 places in the code. This includes changing a role's permissions, replacing a broker commission rule's slabs, setting a broker's primary bank account, moving inquiries when a lead stage is retired, and re-pointing inquiries when applicants are merged.
  • The audit log is protected by the application, not by the database. A database user with write access could still change or delete rows.

Is any action needed beyond upgrading?

No. No database migration, no new environment variable, no deploy-script change, and no permission to re-grant. New audit rows start appearing as soon as the new version is running; old ones are not changed.

If you keep the audit log for compliance, note the date you upgraded: that's when it became complete for the actions above.

How it was checked

  • New tests write each kind of change through the real API and assert the audit row exists with the right user. They fail on v0.7.0 and pass now. One test forces an audit write to fail and checks the change is rolled back rather than reported as saved.
  • A browser test edits a project in the staff app and finds the row in Admin → Audit Log with the editor's name.
  • Upgraded a real install from v0.6.0 to this code, then confirmed in the browser that a project edit appears in Admin → Audit Log with the editor's name, and that the API's service log has no audit errors.

Upgrading

:::bash
cd /opt/openestate-src/deploy/native
sudo ./upgrade-native.sh --ref v0.7.1

Full procedure (backup, rollback behaviour, troubleshooting): Installation Guide.

Known issues

The known issues in the v0.7.0 release notes still apply. See CHANGELOG.md (github.com), the [0.7.1] section, for the full detail, and PR [#53] for the change itself.

Source: README.md, updated 2026-09-24