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

Get Rooms using wrong criteria for owner and member id #211

Closed
ystxn opened this issue Jan 20, 2023 · 0 comments · Fixed by #212
Closed

Get Rooms using wrong criteria for owner and member id #211

ystxn opened this issue Jan 20, 2023 · 0 comments · Fixed by #212
Assignees

Comments

@ystxn
Copy link
Member

ystxn commented Jan 20, 2023

Bug Report

  - get-rooms:
      id: search
      query: "hello"
      owner-id: ${session().id}

Expected Result:

Return search room result

Actual Result:

Exception thrown:

java.lang.NumberFormatException: Cannot parse null string
        at java.base/java.lang.Long.parseLong(Long.java:674) ~[na:na]
        at java.base/java.lang.Long.parseLong(Long.java:836) ~[na:na]
        at com.symphony.bdk.workflow.engine.executor.room.GetRoomsExecutor.toCriteria(GetRoomsExecutor.java:56) ~[classes!/:na]
        at com.symphony.bdk.workflow.engine.executor.room.GetRoomsExecutor.searchRoomsNoPagination(GetRoomsExecutor.java:75) ~[classes!/:na]
        at com.symphony.bdk.workflow.engine.executor.room.GetRoomsExecutor.execute(GetRoomsExecutor.java:34) ~[classes!/:na]

Additional Context:

if (getRooms.getOwnerId() != null) {
criteria.setOwner(new UserId().id(Long.parseLong(getRooms.getCreatorId())));
}
if (getRooms.getMemberId() != null) {
criteria.setMember(new UserId().id(Long.parseLong(getRooms.getCreatorId())));
}

Should be:

    if (getRooms.getOwnerId() != null) {
      criteria.setOwner(new UserId().id(Long.parseLong(getRooms.getOwnerId())));
    }
    if (getRooms.getMemberId() != null) {
      criteria.setMember(new UserId().id(Long.parseLong(getRooms.getMemberId())));
    }
symphony-soufiane added a commit to symphony-soufiane/symphony-wdk that referenced this issue Jan 20, 2023
In get rooms executor, the criteria were wrong where an owner or member id is set because the creator id was used rather. This has been fixed in this PR, more tests are added to improve the coverage and avoid such issues in the future
@symphony-soufiane symphony-soufiane self-assigned this Jan 20, 2023
symphony-soufiane added a commit that referenced this issue Jan 20, 2023
In get rooms executor, the criteria were wrong where an owner or member id is set because the creator id was used rather. This has been fixed in this PR, more tests are added to improve the coverage and avoid such issues in the future.
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 a pull request may close this issue.

2 participants