Skip to content

Conversation

@sakhisheikh
Copy link
Contributor

@sakhisheikh sakhisheikh commented Jan 14, 2026

Implemented method deviceElement:valueForAttribute: to query Label and Identifier attributes.

Note: Dispatch is also fixed in case a consumer has already left and the response comes later, so we can drop that response. Otherwise all subsequent method calls are blocked until the response is consumed

@sakhisheikh sakhisheikh force-pushed the sm-return-label-in-ax branch from b5dd75c to ae8b81c Compare January 21, 2026 15:37
@sakhisheikh sakhisheikh changed the title wip label query Accessibility Inspector: Query AX element's Attibutes Jan 22, 2026
d.responseWaiters[msg.Identifier] <- msg
select {
case d.responseWaiters[msg.Identifier] <- msg:
default:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what situation does this happen? Dispatch is also fixed in case a consumer has already left and the response comes later, is very vague and I understand this more as in that the connection should be closed at that point if the messages are not consumed anymore!?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with Dispatch is, let's say if a consumer leaves because of its own or its parent's ctx timeout then no one will be listening on reading channel. In that case Dispatch will remain stuck here after receiving response:
d.responseWaiters[msg.Identifier] <- msg:

so for example if we call a method and receive response from the response channel. Imagine the consumer waits for x amount of time and exits. And if response comes late from the device in that case the Dispatch will be blocked on writing to the channel.

I also made more changes.

msg, err := d.SendAndAwaitReply(ctx, true, Methodinvocation, payload, auxiliary)
if err != nil {
log.WithFields(log.Fields{"channel_id": d.channelName, "error": err, "methodselector": selector}).Info("failed starting invoking method")
log.WithFields(log.Fields{"channel_id": d.channelName, "error": err, "methodselector": selector}).Info("ailed starting invoking method")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets keep the f 🙂

Suggested change
log.WithFields(log.Fields{"channel_id": d.channelName, "error": err, "methodselector": selector}).Info("ailed starting invoking method")
log.WithFields(log.Fields{"channel_id": d.channelName, "error": err, "methodselector": selector}).Info("failed starting invoking method")

}

func (d *Channel) SendAndAwaitReply(expectsReply bool, messageType MessageType, payloadBytes []byte, auxiliary PrimitiveDictionary) (Message, error) {
func (d *Channel) SendAndAwaitReply(ctx context.Context, expectsReply bool, messageType MessageType, payloadBytes []byte, auxiliary PrimitiveDictionary) (Message, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes a lot of sense to have this method exported, since this is a breaking change anyways, we can unexport it as well

@dmissmann dmissmann merged commit 0427f8d into danielpaulus:main Jan 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants