You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mastodon update to version 2.6.0 | optional one-way mode
- An optional one-way mode can be enabled. In this mode, only content from FlatPress is synced to Mastodon.
- The plugin will not create, update, or delete any FlatPress content.
- Irrelevant options and output are not displayed in the plugin’s admin area when one-way mode is enabled.
Copy file name to clipboardExpand all lines: fp-plugins/mastodon/developer-docs/00-Mental-Model.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ It maps FlatPress objects to Mastodon objects:
15
15
| AudioVideo BBCode | Audio/video media attachments | Requires the FlatPress AudioVideo companion plugin for rendering imported content. |
16
16
| FlatPress tags | Hashtag footer / imported `[tag]` BBCode | Requires the FlatPress Tag companion plugin for tag storage/rendering. |
17
17
| Local delete | Remote delete or tombstone/recheck | Deletion sync reconciles missing local and remote objects later. |
18
+
| One-way import mode | FlatPress-owned source of truth | Optional `disable_remote_import` keeps FlatPress-to-Mastodon export active but blocks Mastodon-created local writes. |
Media export has one additional compatibility rule that developers must keep in mind: one Mastodon status may carry multiple images, or exactly one audio/video attachment, but not a mixed audio/video/image set. The plugin therefore collects all local media for change detection and diagnostics, then selects one exportable media family per status before upload: images first, otherwise one audio item, otherwise one video item with its poster sent only as an upload thumbnail.
AdminUI -. hides import-only controls and counters .-> FP
40
48
Sim --> FP
41
49
Sim --> State
42
50
Sim --> API
43
51
```
44
52
45
53
## The main rule
46
54
47
-
Notification hints are intentionally a hint layer: they can import replies on old Mastodon threads quickly when `read:notifications` is authorized, while context rotation remains the bounded fallback.
55
+
Notification hints are intentionally a hint layer: they can import replies on old Mastodon threads quickly when `read:notifications` is authorized, while context rotation remains the bounded fallback. When `disable_remote_import` is enabled, notification hints and context rotation are skipped as local-write sources; FlatPress still exports local entries and comments to Mastodon.
56
+
57
+
The admin UI follows the same direction gate. With one-way mode active it hides Mastodon-to-FlatPress import options, notification-scope hints and import-only/local-write counters, but the save handler preserves those hidden import settings so they come back unchanged if bidirectional synchronization is re-enabled. The one-way admin UI hides import-only controls, notification-scope hints and import-only/local-write counters while preserving hidden import settings on save.
48
58
49
59
Do not reason about a single function in isolation. The important question is usually:
50
60
51
61
> Which state field is written now, and which later sync path will read it?
52
62
53
-
Example: a locally deleted mapped comment does not merely remove a local file. It may mark `deletions_pending`, later enter deletion sync, create or respect a comment tombstone, queue descendant rechecks, and prevent a deleted remote reply from being imported again.
63
+
Example: a locally deleted mapped comment does not merely remove a local file. It may mark `deletions_pending`, later enter deletion sync, create or respect a comment tombstone, queue descendant rechecks, and prevent a deleted remote reply from being imported again. Conversely, in explicit one-way mode a remotely deleted status must not delete the still-existing FlatPress object; it unlinks the stale remote mapping and queues the local entry or comment for re-export.
| Full sync state | Authoritative mapping and dirty/deletion state. |`state.json`, `plugin_mastodon_state_read()`, `plugin_mastodon_state_write()`. |
61
71
| Compact scheduler state | Fast request-time status without loading huge mapping arrays. |`scheduler-state.json`, `plugin_mastodon_scheduler_state_read()`. |
62
72
| Locks and guards | Prevent concurrent or too frequent sync runs on shared hosting. |`sync.lock`, `sync.guard.json`, `plugin_mastodon_sync_guard_active()`, `plugin_mastodon_sync_guard_mark()`. |
@@ -83,6 +93,7 @@ The simulation executes the real Mastodon plugin code against a local FlatPress-
83
93
1. Read the one-page model above and keep `state.json` as the central mental anchor.
84
94
2. Locate the affected process ID in `01-Process-Map.md`.
85
95
3. Check whether the process is local-to-remote, remote-to-local, deletion-only, or admin-only.
96
+
4. One-way mode is a direction gate: it never blocks FlatPress-to-Mastodon export, but it blocks Mastodon-to-FlatPress create, update and delete effects.
86
97
4. Read the corresponding state fields in `02-State-Model.md`.
87
98
5. Find the implementation functions in `03-Function-Process-Matrix.md`.
88
99
6. If Mastodon is contacted, check endpoint version and fallback behavior in `04-API-Compatibility.md`.
0 commit comments