Setting the Id or adding any attributes to a AudioMessage results in a duplicate key exception.

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp

Research direction

Start with AudioHostApplicationClient.GetOrCreateString() and the LibVst implementation of AudioHostAppication.TryCreateMessage(). Trace how the messageId and named attributes are stored, then verify that creating an AudioMessage assigns its id and setting attributes no longer raises the duplicate-key exception.

Written by the indexing model from the issue text.

Description

bug PR welcome

Whenever an AudioMessage is created via AudioHostAppication.TryCreateMessage(), a blank message is returned without an id. The messageId parameter passed to TryCreateMessage appears to be unused in the LibVst implementation of AudioHostAppicationClient. Furthermore, setting the message id manually or setting any named attribute results in an ArgumentException specifying "An item with the same key has already been added." It looks like this is happening because inside AudioHostApplicationClient.GetOrCreateString(), a call is made to CollectionMarshal.GetValueRefOrAddDefault(). Later in the function Add() is being called on the dictionary to set the allocated string pointer, but the value gets added as a default by the CollectionMarshal call.

Dominant language
C#
Stars
152
Forks
11
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xoofx/NPlug

All issues in xoofx/NPlug

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.