anchor.diff:  %%--------------------------------------------------------------------
   -spec links_save(model(), key(), doc()) -> undefined | doc().
   links_save(Model, RoutingKey, Doc = #document{key = Key}) ->
  -    Ctx = datastore_model_default:get_ctx(Model),
  +    Ctx = get_ctx(Model),
       Ctx2 = Ctx#{
           sync_change => true,
           local_links_tree_id => oneprovider:get_id()
  
positive.code:                 links_delete(Doc);
              _ ->
                  Model = element(1, Value),
                  Ctx = datastore_model_default:get_ctx(Model),
                  Ctx2 = Ctx#{sync_change => true, hooks_disabled => true},
                  case datastore_model:save(Ctx2, Doc) of
                      {ok, Doc2} ->
  
negative.code:     LocalTreeId = oneprovider:get_id(),
      case TreeId of
          LocalTreeId ->
              Ctx = get_ctx(Model),
              Ctx2 = Ctx#{
                  sync_change => true,
                  local_links_tree_id => LocalTreeId
  