Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ron-rdt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0)
and this project adheres to
[Compatible Versioning](https://github.com/staltz/comver).

## [0.12.1] - 2026-03-16
* Added some duplicate operation removal to `vertexListFromOps`
* Changed `applyPatch` to prefer new operations over existing ones when
updating the `HashMap UUID VertexListItem`.

## [0.12] - 2022-03-11
- Added `Editable` typeclass which generalizes RON.Data.RGA.edit

Expand Down
1 change: 1 addition & 0 deletions ron-rdt/lib/RON/Data/LWW.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

-- | LWW-per-field RDT
module RON.Data.LWW (
Expand Down
1 change: 1 addition & 0 deletions ron-rdt/lib/RON/Data/ORSet/Experimental.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

module RON.Data.ORSet.Experimental (
ORSet,
Expand Down
5 changes: 3 additions & 2 deletions ron-rdt/lib/RON/Data/RGA.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import qualified Data.HashMap.Strict as HashMap
import Data.Map.Strict ((!?))
import qualified Data.Map.Strict as Map
import qualified Data.Text as Text
import Data.List (nubBy)

import RON.Data.Internal (MonadObjectState,
Editable (..),
Expand Down Expand Up @@ -119,7 +120,7 @@ vertexListToOps v@VertexList {..} = go listHead listItems
in itemValue : rest

vertexListFromOps :: [Vertex] -> Maybe VertexList
vertexListFromOps = foldr go mempty
vertexListFromOps = foldr go mempty . nubBy (\Op{opId = opIdA} Op{opId = opIdB} -> opIdA == opIdB)
where
go v@Op{opId} vlist = Just VertexList{listHead = opId, listItems = vlist'}
where
Expand Down Expand Up @@ -276,7 +277,7 @@ applyPatch parent patch targetItems = case parent of
Nothing -> patch
Just next -> VertexList next targetItems <> patch
let item' = item {itemNext = Just next'}
pure $ HashMap.insert parent item' targetItems <> newItems
pure $ HashMap.insert parent item' newItems <> targetItems

reapplyRemovalsToState :: (RgaRep, PatchSet) -> Maybe (RgaRep, PatchSet)
reapplyRemovalsToState (RgaRep rstate, ps@PatchSet {..}) = do
Expand Down
2 changes: 1 addition & 1 deletion ron-rdt/ron-rdt.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.2

name: ron-rdt
version: 0.10
version: 0.12.1

bug-reports: https://github.com/ff-notes/ron/issues
category: Distributed Systems, Protocol, Database
Expand Down