asobi_extension_export (asobi v0.84.0)

View Source

Collects every installed extension's export section for one player.

The read half of asobi_extension_erase, and shaped on it: walk asobi_extensions:resolve/0, call export_player/1 on each extension that exports one, and stop at the first failure. The result names every installed extension - one without the callback contributes a skipped marker rather than nothing, so a skipped extension is visible in the artefact a data subject or auditor reads, not an absence nobody can detect. See asobi_extension:export_player/1 for why the marker is the forcing function that let this callback ship at all.

A missing callback is a marker; a failing callback fails the export. An extension that exports the callback and then returns {error, _} or raises promised data and could not deliver it - exactly the silent incompleteness the marker exists to prevent - so the caller must produce no artefact. Fail loudly and retry beats a partial export presented as complete. A section json:encode/1 refuses is the same failure: the export is served as one JSON object, so an unencodable term would otherwise become an unattributed 500 after the payload had already left the controller.

No transaction: core's own export is a sequence of plain reads with no transaction around them, and wrapping only this walk in one would buy consistency with nothing. An extension that raises is caught rather than allowed to propagate, so the failure is attributed to a name before it becomes the caller's problem.

Failure reasons carry the shape of what came back - a tag and a size, a truncated formatted reason, the top stack frame without arguments - never the term itself. What an extension returns on this path is the data subject's personal data, and a reason term flows into the log line below and into the caller's error; neither may hold what the export refused to produce.

Summary

Functions

Every installed extension by name: #{data => ...} from one that exported, #{skipped => ...} for one without the callback. Or the first extension to fail and why; nothing is retried and nothing after it is attempted.

Functions

run(PlayerId)

-spec run(binary()) ->
             {ok, #{asobi_extension:name() => map()}} | {error, {asobi_extension:name(), term()}}.

Every installed extension by name: #{data => ...} from one that exported, #{skipped => ...} for one without the callback. Or the first extension to fail and why; nothing is retried and nothing after it is attempted.