// ensureParentAnchorsAreProcessed checks all ancestors (parents, grandparents, etc.) of the given anchor event
// and processes all that have not yet been processed.
ensureParentAnchorsAreProcessed checks all ancestors (parents, grandparents, etc.) of the given anchor event
and processes all that have not yet been processed.
// ensureParentAnchorsAreProcessed checks all ancestors ( parents grandparents etc . ) of the given anchor event // and processes all that have not yet been processed .
func (h *AnchorEventHandler) ensureParentAnchorsAreProcessed(anchorEventRef *url.URL,
	anchorEvent *vocab.AnchorEventType) error {
	unprocessedParents, err := h.getUnprocessedParentAnchorEvents(anchorEventRef.String(), anchorEvent)
	if err != nil {
		return fmt.Errorf("get unprocessed parent anchor events for %s: %w", anchorEventRef, err)
	}
	logger.Debugf("Processing %d parents of anchor event %s: %s",
		len(unprocessedParents), anchorEventRef, unprocessedParents)
	for _, parentAnchorInfo := range unprocessedParents {
		logger.Infof("Processing parent of anchor event [%s]: [%s]",
			anchorEventRef, parentAnchorInfo.Hashlink)
		err = h.processAnchorEvent(parentAnchorInfo)
		if err != nil {
			return fmt.Errorf("process anchor event %s: %w", parentAnchorInfo.Hashlink, err)
		}
	}
	return nil
}
func ( h * AnchorEventHandler ) ensureParentAnchorsAreProcessed ( anchorEventRef * url . URL , anchorEvent * vocab . AnchorEventType ) error { unprocessedParents , err := h . getUnprocessedParentAnchorEvents ( anchorEventRef . String ( ) , anchorEvent ) if err != nil { return fmt . Errorf ( " " , anchorEventRef , err ) } logger . Debugf ( " " , len ( unprocessedParents ) , anchorEventRef , unprocessedParents ) for _ , parentAnchorInfo := range unprocessedParents { logger . Infof ( " " , anchorEventRef , parentAnchorInfo . Hashlink ) err = h . processAnchorEvent ( parentAnchorInfo ) if err != nil { return fmt . Errorf ( " " , parentAnchorInfo . Hashlink , err ) } } return nil }
ensureParentAnchorsAreProcessed checks all ancestors (parents, grandparents, etc.)
ensureParentAnchorsAreProcessed checks all ancestors ( parents grandparents etc . )