# Changelog of Vietnam Lottery Results Scraper (XSMN, XSMT, XSMB) (`mrbridge/vietnam-lottery-results-scraper`) Actor

- **URL**: https://apify.com/mrbridge/vietnam-lottery-results-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/mrbridge/vietnam-lottery-results-scraper.md

## Changelog

### 0.1.10 (2026-11-24, build 0.1.9)

- The README now explains how to research the draw history and check a published result for analysis.
- The "Your feedback" section now invites you to leave a review on the Store page.
- Updated `basic-ftp` from 6.2.1 to 6.2.4 via `overrides`. No behavior change for users. The production `npm audit` was clean.
- Input, dataset rows and billing are unchanged.

### 0.1.9 (2026-11-03)

- Pinned `follow-redirects` 1.16.2 and `minimatch` 11.0.3 through `overrides`, and `undici` 7.30.1 through the lock, to clear the `npm audit` alerts. No code change.
- Input, dataset rows and billing are unchanged.

### 0.1.8 (2026-10-29)

- Documentation only. The README now explains that `OUTPUT.drawsCharged` is the Actor's own count: after a restart, the bill in the Apify Console can be lower than it by at most `OUTPUT.reconciledDraws`, never higher, and a draw is never billed twice.
- The run time of a one-year run is now given for the default 512 MB (about 20 minutes, about 33 minutes at 256 MB).
- No change to the input schema, the rows or the code.

### 0.1.7 (2026-10-28)

- More memory headroom. A one-year run in `number` format could run out of memory at the default 256 MB and stop with no `OUTPUT`. The Actor now caps its heap below the container limit, keeps fewer fetched pages waiting, and no longer keeps any page text once its draws are read.
- After a restart, the run log always says what was found in the dataset (`Reconciled N row(s) and M error record(s) from the dataset.`), even when nothing was found.
- `OUTPUT.reconciledDraws` and `OUTPUT.reconciledRows` are now totals over every restart of the run. Before, they only counted the last restart.
- If a charge bills fewer draws than were just delivered, the run stops delivering and logs a warning that names the gap.
- No change to the input schema or to the rows.

### 0.1.6 (2026-10-28)

- No draw is billed twice after a restart without warning. Before, a run restarted right after billing a page could bill a few of its draws a second time (3 draws in a test run over one year), because the count of billed events read back at the restart was a few events behind. Now each page of draws is delivered first and billed right after, in both formats, and a draw found in the dataset at a restart counts as billed: nothing is charged for it again. If the restart falls in the instant between the delivery of a page and its billing, the draws of that page (4 at most) stay unbilled.
- The `OUTPUT` record has a new field, `reconciledDraws`: the draws found in the dataset at a restart (0 on a run that was not restarted). The field `datasetRows` is removed, with the warning that came with it: the row count read from the dataset at the end of a run lags behind the last rows written and gave false warnings.
- No change to the input schema or to the rows.

### 0.1.5 (2026-10-27)

- A run restarted by the platform without warning (a reboot stops the container in a few milliseconds) no longer repeats the rows of the page it was writing. At each start the run checks the end of its datasets against its saved progress: rows and error records already there are not pushed again, and each delivered draw is billed exactly once, even when the stop fell between the delivery of a page and its billing.
- The `OUTPUT` record has two new fields: `datasetRows`, the row count read from the default dataset at the end of the run (it equals `rowsPushed`, a warning is logged otherwise, `null` when the run requested nothing), and `reconciledRows`, the rows found in the dataset at a restart (0 on a run that was not restarted).
- No change to the input schema or to the rows.

### 0.1.4 (2026-10-27)

- A run moved to another server by the platform now picks up where it stopped. Before, it started again from the first page, so the rows already delivered came twice and were billed twice.
- After such a restart the rows, the billed draws and the `OUTPUT` record are the same as for a run that was never moved. `maxDraws` keeps counting the draws delivered before the move, and the dates of the run stay those of its first start, even past midnight in Vietnam.
- No change to the input schema or the output format. The run keeps its progress in a `RUN_STATE` record of its key-value store.

### 0.1.3 (2026-10-26)

- Documentation only, no change to the code, the input schema or the output format.
- README: measured duration of a one-year replay (about 21 minutes for 1,095 pages and about 2,400 draws), valid province codes by region and the `BAD_INPUT` rule with its `details` keys, the `apify-actor-start` event billed by the platform even on invalid input, the progress line, the `chargeLimit` stop, the Tết 2026 days without a North draw, `specialCodes` as `[]` on old North pages, special prizes of 5 or 6 digits on old draws.

### 0.1.2 (2026-10-26)

- Faster runs: fetching no longer waits for rows to be delivered. A one-year range of the three regions (1,095 pages, 2,396 draws) now takes about 21 minutes instead of about 33, with identical rows and a lower cost per 1,000 draws.
- One SDK call per page of draws instead of one per row, and every attempt to fetch a page now goes through the request rate limiter.
- A long run writes a progress line about every minute (pages done, draws emitted, error rows, estimated time left).
- An unknown province code, or a code outside the selected regions, now stops the run with one `BAD_INPUT` row. Its `details` hold `unknownProvinces`, `validCodes` and, when a known code is outside the selected regions, `mismatchedProvinces`. Before, an unknown code only logged a warning and the run returned no row.

### 0.1.1 (2026-10-26)

- First functional version.
- Reads the results of the three regions (South, Centre, North) from xsmn.mobi: one row per province draw (`draw`) or one row per drawn number (`number`).
- Modes `latest` (most recent complete draw, stepping back up to 7 days) and `dateRange` (up to 366 days per run).
- Coverage: North from 2008-01-01, South and Centre from 2009-01-01. South and Centre special prizes before about 2012 have five digits and are returned as they appear.
- Province filter, `maxDraws` cap (default 1000) counted in draws in both formats.
- Billing: one `draw` event per delivered draw in both formats. Errors, days without a draw and pending draws are never billed.
- Problems go to a separate `errors` dataset. The `OUTPUT` record summarizes the run (pages by status, draws, days without a draw, pending draws, errors by kind, `stoppedBy`).
- Blocked pages are retried through another proxy up to 3 times. After 4 blocked pages in a row the run stops cleanly.
