Skip to content

[TOPIC] si topic create does not work with space API #916

Open
@a-tylenda

Description

@a-tylenda

Describe the bug
When creating a new topic using the command si topic create <topicName> it should be added to the space topic list.

Steps to Reproduce

==LOCAL infra==

In the infrastructure MW MM, sth-1, sth-2:

1.  I create topic named newTopic on sth-1

si hub use sth-1

si topic create newTopic

$ si topic create newTopic
{
  id: 'newTopic',
  origin: { id: '::', type: 'hub' },
  state: 'flowing',
  contentType: 'text/plain'
}

2. I check topic list on sth-1, topic is present on the list:

$ si topic ls
[
  {
    contentType: 'text/plain',
    localProvider: '',
    topic: 'newTopic',
    topicName: 'newTopic'
  }
]

3. I check list on sth-2, topic is not present on the list.

$ si hub use sth-2
$ si topic ls
[]

4. I check topic list on space, topic is not present on the list:

curl GET 'http://0.0.0.0:7000/api/v1/space/org-ad6fcd3f-872b-4f7c-b84a-fc64e0a4ad41-manager/api/v1/topics'
[]

==STAGE:==

The same on stage:

$ si topic ls
[]

13:56 $ si topic create newTopic
{
  id: 'newTopic',
  origin: { id: '::', type: 'hub' },
  state: 'flowing',
  contentType: 'text/plain'
}

13:57 $ si topic ls
[
  {
    contentType: 'text/plain',
    localProvider: '',
    topic: 'newTopic',
    topicName: 'newTopic'
  }
]

$ curl  -X GET \
>   'https://api.scp.ovh/api/v1/space/org-f8d19d60-0dc6-446b-9794-c701f5c3a584-manager/api/v1/topics' \
>   --header 'Accept: */*' \
>   --header 'Authorization: Bearer xxx'|jq

[]

The topic list (array) is empty, should contain an object with the topic name newTopic.

Expected behavior
Created topic by command si topic create <topicName> should be added to the space topic list.

Version (please complete the following information):

  • STH version: 0.35.0
  • SI version: 0.35.0
  • node version: v18.15.0
  • os: Ubuntu 20.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    readRead by sequences

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions