Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using query.next() with no parameters does not work as specified #903

Closed
kvnify opened this issue Oct 5, 2020 · 6 comments
Closed

Using query.next() with no parameters does not work as specified #903

kvnify opened this issue Oct 5, 2020 · 6 comments
Assignees
Labels
fix checked in IoTSDK tracks all IoT SDK issues across the board

Comments

@kvnify
Copy link

kvnify commented Oct 5, 2020

Context

  • OS and version used: macOS 10.15.7
  • Node.js version: 10.20.1
  • npm version: 6.14.4

Description of the issue

I'm implementing an HTTP triggered Azure function to query my DPS for the list of enrolment group registration states using the azure-iot-provisioning-server module. I create the client, construct the query spec and when I trigger the query using query.next() the function throws and error.

When I modify the execution of the query, to use the query callback and wrap that in a promise, I can work around this issue. But the API does not seem to work as written.

Code sample exhibiting the issue

    // Inside and `async` function
    const dpsClient = ProvisioningServiceClient.fromConnectionString(dpsConnStr)
    const query = dpsClient.createEnrollmentGroupDeviceRegistrationStateQuery({
        query: '*'
    }, enrollmentGroupId, 500)
    const { responseBody } = await query.next()
    // BOOM!

Console log of the issue

LanguageWorkerConsoleLog[error]
Worker e6a958c5-7cb7-4abb-8ec4-77a5ea194d12 uncaught exception (learn more: https://go.microsoft.com/fwlink/?linkid=2097909 ): TypeError: actualCallback is not a function
     at ~/functions/node_modules/azure-iot-provisioning-service/dist/query.js:37:21
	 at requestCallback (~/functions/node_modules/azure-iot-http-base/dist/rest_api_client.js:142:17)     
	 at IncomingMessage.<anonymous> (~/functions/node_modules/azure-iot-http-base/dist/http.js:118:17)     
	 at IncomingMessage.emit (events.js:203:15)     
	 at endReadableNT (_stream_readable.js:1145:12)     
	 at process._tickCallback (internal/process/next_tick.js:63:19)
Executed 'Functions.things' (Failed, Id=80a1aa0c-7cf6-4464-bcb4-359cbded357e, Duration=760ms)
System.Private.CoreLib: Exception while executing function: Functions.things. System.Private.CoreLib: node exited with code 1
 LanguageWorkerConsoleLog[error] Worker e6a958c5-7cb7-4abb-8ec4-77a5ea194d12 uncaught exception (learn more:
 https://go.microsoft.com/fwlink/?linkid=2097909 ):
 TypeError: actualCallback is not a function     
 	at /~/functions/node_modules/azure-iot-provisioning-service/dist/query.js:37:21     
	 at requestCallback (~/functions/node_modules/azure-iot-http-base/dist/rest_api_client.js:142:17)     
	 at IncomingMessage.<anonymous> (~/functions/node_modules/azure-iot-http-base/dist/http.js:118:17)     
	 at IncomingMessage.emit (events.js:203:15)     
	 at endReadableNT (_stream_readable.js:1145:12)     
	 at process._tickCallback (internal/process/next_tick.js:63:19).

AB#8492768

@kvnify kvnify added the bug label Oct 5, 2020
@github-actions github-actions bot added the IoTSDK tracks all IoT SDK issues across the board label Oct 5, 2020
@kvnify kvnify changed the title Using Query::next() with no parameters does not work as specified Using query.next() with no parameters does not work as specified Oct 5, 2020
@jebrando
Copy link
Collaborator

jebrando commented Oct 9, 2020

Thank you for the issue we will take a look and see if we can find an issue.

BertKleewein added a commit to BertKleewein/azure-iot-sdk-node that referenced this issue Nov 2, 2020
BertKleewein added a commit that referenced this issue Nov 2, 2020
fix (azure-iot-provisioning-server): #903 - Using  with no parameters does not work as specified
@BertKleewein
Copy link
Member

@khendry - I got a fix for this committed to master, but I just missed the 11/2 release (1.8.7 I think).

@erikerikson
Copy link

The associated fix is neither in the official version or @latest. Is there a release timeline?

@BertKleewein
Copy link
Member

@erikerikson - I am checking with the release team

@anthonyvercolano
Copy link
Contributor

This will be in the next release. I am hoping within the next 10 days.

@anthonyvercolano
Copy link
Contributor

Provisioning service client released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix checked in IoTSDK tracks all IoT SDK issues across the board
Projects
None yet
Development

No branches or pull requests

6 participants