siyuan-note/siyuan · error

attribute view snapshot context is ambiguous [%s]

Error message

attribute view snapshot context is ambiguous [%s]

What it means

Error "attribute view snapshot context is ambiguous [%s]" thrown in siyuan-note/siyuan.

Source

Thrown at kernel/model/attribute_view_render.go:1060

	index, err := repo.GetIndex(indexID)
	if err != nil {
		return "", err
	}
	files, err := repo.GetFiles(index)
	if err != nil {
		return "", err
	}
	var matches []*entity.File
	for _, file := range files {
		if strings.HasSuffix(file.Path, "/storage/av/"+avID+".json") {
			matches = append(matches, file)
		}
	}
	if len(matches) == 0 {
		return "", av.ErrAttributeViewNotFound
	}
	if len(matches) != 1 {
		return "", fmt.Errorf("attribute view snapshot context is ambiguous [%s]", avID)
	}
	boxID := avBoxIDFromRepoPath(matches[0].Path)
	if IsEncryptedBox(boxID) {
		return boxID, nil
	}
	return "", nil
}

// ResolveHistoryAttributeViewBoxID 返回历史属性视图的唯一加密笔记本上下文。
func ResolveHistoryAttributeViewBoxID(avID, created string) (string, error) {
	if !ast.IsNodeIDPattern(avID) {
		return "", ErrInvalidID
	}
	createdUnix, err := strconv.ParseInt(created, 10, 64)
	if err != nil {
		return "", fmt.Errorf("parse created [%s] failed: %w", created, err)
	}
	dirPrefix := time.Unix(createdUnix, 0).Format("2006-01-02-150405")

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Provide enough context (notebook/box ID) so the snapshot can be resolved unambiguously.
  2. Avoid passing identifiers that match multiple notebooks or snapshots.

Example fix

Include the notebook ID together with the snapshot reference when requesting the history snapshot render.

When it happens

Trigger: Rendering an attribute view history snapshot whose identifiers match more than one notebook context.

Common situations: Occurs when a snapshot restore request matches multiple notebooks or none, so the kernel cannot decide where the attribute view belongs.


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/bba0caa3915f9daf. Report an issue: GitHub.