Commit Graph
20 Commits
Author SHA1 Message Date
Chris Troutner 2e2db86263 Implement multi-push encoding for Memo multi-field actions
Reply, topic message, add-poll-option, poll-vote, and create-poll now
broadcast each protocol field as its own OP_RETURN script push instead of
combining them into one push. The indexer requires three pushes for reply,
topic message, and poll children, and accepts four for create-poll; the
combined form was rejected or misparsed.

hex.js builds the txid and text as separate pushes, and a new
memo-multipush adapter teaches minimal-slp-wallet's single-push sendOpReturn
to expand an array of fields into separate pushes. Acceptance step handlers
assert the individual pushes, and unit/property tests cover the new shape.

By coder.
2026-09-16 20:37:59 -07:00
Chris Troutner a76fceee73 Refactor txid wire encoding and repair library
Share the txid-and-text payload builder between hex and reply, extract the
repair store loop from repairTxidEncoding to cut CRAP from 13 to 5, correct
the poll-services property test to the little-endian wire order, and add
property tests for wire round trips and repair idempotence/conservation.

By refactorer.
2026-09-16 14:59:00 -07:00
Chris Troutner e978516a0f Refactor like result modal and share the block explorer link
Deduplicate the new like-result acceptance steps behind one render helper,
and extract the bch.loping.net transaction link shared by the New Post result
modal, the post options menu, and the like/tip result into a block-explorer
service. Cover the LikeTipPage open/parse/handler failure branches and add
property tests for the explorer URL, the LikeResult markup, and the result
modal state machine.

CRAP is at or below 5 with full coverage on the changed services; every
changed/new plain source file scans at 21 or fewer mutation sites. The
existing mutation manifests are left for the mutation tool to refresh.

By refactorer.
2026-09-16 12:03:41 -07:00
Chris Troutner d0882bbd82 Refactor post options menu and add property tests
Move the keyboard shortcut mapping into the pure post-options service so the
React component is a thin adapter and the Escape/ArrowDown decisions are unit
and property testable. DRY the duplicated post-options acceptance steps behind
two helpers, and add property tests for the explorer URL, menu-item shape,
state transitions, key command, and rendered markup.

The createElement post-options component and service stay scannable by
mutate4javascript; the JSX call sites (post-feed-item, profile) are unchanged
except for rendering the shared menu.

By refactorer.
2026-09-16 09:48:36 -07:00
Chris Troutner e77e174c92 Refactor post image rendering and cover image helpers
Extract the pure failed-image set transition into a testable service,
DRY the acceptance no-link/no-image assertions, and add property tests
for image URL detection, alt text, and image rendering.

By refactorer.
2026-09-16 07:20:40 -07:00
Chris Troutner e17c515065 Add property tests for post link parsing
Cover parsePostLinks invariants over broad seeded random inputs: round
trip reconstruction, link/text segment shape, trailing-punctuation
handling, input ordering, email exclusion, and determinism.

By refactorer.
2026-09-15 19:20:48 -07:00
Chris Troutner 8088d73fc3 Add property tests for account page avatar display logic
By refactorer.
2026-09-05 13:09:09 -07:00
Chris Troutner 5e1f4739e3 Broadcast follow/mute/unfollow/unmute hash160 payloads as Uint8Array
Replaces the Node-only Buffer global in memo-follow and memo-mute with
the existing hexToBytes helper, which returns a Uint8Array. Updates unit
and property tests to assert bytes without requiring Buffer in the
production source, and adds an acceptance handler for the new binary
payload wording so the Binary Payload Broadcast regression spec passes.

By coder.
2026-09-04 11:13:15 -07:00
Chris Troutner a9488d9ae2 Refactor paginated pages onto shared base, add property coverage
Extract PaginatedPage base for the recent feed and recent profiles page
controllers to remove the duplicated load/canLoadMore pattern introduced
with the 50-item page size. Refresh mutation manifests via the tool. Add
property tests for the base pagination invariants (canLoadMore mirrors
hasMore, load forwards limit/offset, item lookup).

By refactorer.
2026-09-04 10:06:27 -07:00
Chris Troutner 9ec8760b59 Add property tests for youtube-embed parser invariants
Cover round-trip reconstruction, segment shape, non-YouTube URLs staying
text, and video-id round trips over broad random inputs.

By refactorer.
2026-09-04 09:43:51 -07:00
Chris Troutner 5c6bffd6de Add getViewerAddress property tests for reactive precedence
Pin the profile wallet-address selector invariants over broad input
space: reactive-state precedence, wallet fallback, and null-on-absent.
CRAP (3.0), DRY, and mutation scan assessed; no split needed and no
manifests discarded.

By refactorer.
2026-09-03 16:13:15 -07:00
Chris Troutner d606ee6608 Refactor following feed: reduce CRAP/DRY, add property coverage
- Extract shared runUseCase and listPostsForAddr in the posts controller to
  remove the duplicated try/catch error wrapper (CRAP 14.7 -> 4.0) and DRY
  the addr-scoped handlers.
- Add error-path unit tests for the posts controller covering both branches
  of handleError.
- Consolidate ListFollowingFeed onto the shared ListUseCase constructor to
  remove constructor duplication across list use cases.
- Add property tests for scanFollowingFeedTxidsAndCount (ordering, reply/
  viewer/membership exclusion, pagination conservation) and for the client
  FollowingFeedPage.load state invariants.

By refactorer.
2026-08-29 10:44:28 -07:00
Chris Troutner d8ab5bc79c Refactor mute-user: reduce DRY, add property coverage
Extract shared _getState/_getList helpers in the client MemoDb, a shared
_loadState/_setState base in ProfilePage, and a runAction helper for the
profile follow/mute handlers. Add property tests for the MemoMute service,
the DB MuteQuery adapter, and the indexer handleMute action. Preserve
behavior; all unit, acceptance, and property suites pass across client, DB,
and indexer.

By refactorer.
2026-08-28 19:58:39 -07:00
Chris Troutner 739b13bfb2 Refactor poll actions: reduce CRAP/DRY, add property coverage
Extract shared txid-action and poll-page bases in the client, a shared
poll-read use-case base and a poll-txid iteration helper in the DB, and a
shared poll-child record helper in the indexer. Reduce normalizePollCreateDatas
complexity (CRAP 7.1 -> 5.0). Add property tests for poll services, handlers,
and query filtering. Preserve behavior; all unit, acceptance, and property
suites pass across client, DB, and indexer.

By refactorer.
2026-08-28 15:23:04 -07:00
Chris Troutner d6f56780be Refactor topic actions: reduce CRAP/DRY, add property coverage, complete acceptance
- Add unit coverage for Profiles topic follow state to bring CRAP to 4.
- DRY Profiles set/get follow state via shared nested-map helpers.
- Add TopicQuery topic-follow read-side property tests and MemoTopicPost
  byte-accounting property tests.
- Complete client and DB acceptance step handlers and mocks for the
  topic-follow and topic-post features.

By refactorer.
2026-08-28 11:13:03 -07:00
Chris Troutner 4c5fb38661 Refactor topic feed: reduce CRAP, DRY, and add property coverage
- Add topics controller error-handling unit tests to bring handleError
  CRAP from 14.7 to 4.0.
- Consolidate duplicate getTopicPosts/getPostsByAddr HTTP page fetches
  into a shared getPage helper in memo-db (DRY).
- Add TopicQuery property tests: listTopics conservation/ordering,
  getTopicPostTxids newest-first pagination, and room/txid key round-trips.
- Add client topic-services property tests for getTopic/getPost lookup
  completeness.

By refactorer.
2026-08-28 06:43:18 -07:00
Chris Troutner d9ba5a2774 Refactor follow use-cases and profile page; add follow property tests
Share the follow list use-case contract through a FollowListUseCase base
and delegate construction validation to the existing ListUseCase, removing
the duplicated follow use-case constructors and execute bodies. Extract
ProfilePage.load helpers and a shared follow/unfollow setter to reduce
CRAP below the threshold and remove duplicated follow logic. Add property
tests covering MemoFollow broadcast conservation and hash160 length, the
FollowQuery address round trip, and isFollowing/listFollowing/listFollowers
consistency over random record sets.

By refactorer.
2026-08-27 10:46:39 -07:00
Chris Troutner 58e21ff01a Deduplicate Memo profile-text actions and add set-avatar-url property tests
Extract a shared MemoProfileTextAction base with a config factory so the
set-name, set-bio, and set-avatar-url actions each become a thin data
declaration, removing the duplicated config and broadcast method. Add
property tests covering the avatar URL byte limit, round trips, and byte
budget conservation.

By refactorer.
2026-08-27 09:57:13 -07:00
Chris Troutner 9c5767d462 Refactor set-bio to share profile-text action and page bases
Deduplicate the set-bio and set-name action and page-controller layers:
move byte-limit and profile-store reflection into MemoAction via config,
and share a ProfileTextPage base for both page controllers. Add property
tests for byte counting and the bio byte-limit boundary.

By refactorer.
2026-08-27 08:00:58 -07:00
Chris Troutner c208eb38aa Refactor like-count read side and add property tests
- Reduce GetPostThread.buildThreadNode CRAP from 10 to 5 by extracting
  fetchPostOrNull, loadChildTxids, and compareReplies helpers.
- Add like-count property tests (conservation, round-trip, pagination).
- Update post-height property test for the new likesDb requirement.
- Add client thread-page flatten property test and a small harness.

By refactorer.
2026-08-26 19:55:19 -07:00