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

adding/removing access control to a dataset results in additional links #775

Open
maaikelimper opened this issue Sep 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@maaikelimper
Copy link
Collaborator

maaikelimper commented Sep 19, 2024

After adding removing access control to a dataset we end up with duplicate "observation"-buttons which appear to be due to links being added to the discovery metadata record whenever access-control is added and removed:

image

links section, note the duplicated links:

"links": [
{
"href": "http://dvila.wis2.training/oapi/collections/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=json",
"type": "application/json",
"name": "urn:wmo:md:ar-dvila:reco.surface-based-observations.synop",
"rel": "collection",
"title": "urn:wmo:md:ar-dvila:reco.surface-based-observations.synop"
},
{
"href": "mqtt://everyone:[email protected]:1883",
"type": "application/json",
"name": "origin/a/wis2/ar-dvila/data/recommended/weather/surface-based-observations/synop",
"rel": "items",
"channel": "origin/a/wis2/ar-dvila/data/recommended/weather/surface-based-observations/synop",
"title": "Notifications"
},
{
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop",
"type": "application/geo+json",
"name": "urn:wmo:md:ar-dvila:reco.surface-based-observations.synop",
"rel": "canonical",
"title": "urn:wmo:md:ar-dvila:reco.surface-based-observations.synop"
},
{
"type": "application/json",
"rel": "root",
"title": "The landing page of this server as JSON",
"href": "http://dvila.wis2.training/oapi?f=json"
},
{
"type": "text/html",
"rel": "root",
"title": "The landing page of this server as HTML",
"href": "http://dvila.wis2.training/oapi?f=html"
},
{
"rel": "self",
"type": "application/geo+json",
"title": "This document as JSON",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=json"
},
{
"rel": "alternate",
"type": "application/ld+json",
"title": "This document as RDF (JSON-LD)",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=jsonld"
},
{
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=html"
},
{
"rel": "collection",
"type": "application/json",
"title": "Discovery metadata",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata"
},
{
"type": "application/json",
"rel": "root",
"title": "The landing page of this server as JSON",
"href": "http://dvila.wis2.training/oapi?f=json"
},
{
"type": "text/html",
"rel": "root",
"title": "The landing page of this server as HTML",
"href": "http://dvila.wis2.training/oapi?f=html"
},
{
"rel": "self",
"type": "application/geo+json",
"title": "This document as JSON",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=json"
},
{
"rel": "alternate",
"type": "application/ld+json",
"title": "This document as RDF (JSON-LD)",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=jsonld"
},
{
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=html"
},
{
"rel": "collection",
"type": "application/json",
"title": "Discovery metadata",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata"
},
{
"type": "application/json",
"rel": "root",
"title": "The landing page of this server as JSON",
"href": "http://dvila.wis2.training/oapi?f=json"
},
{
"type": "text/html",
"rel": "root",
"title": "The landing page of this server as HTML",
"href": "http://dvila.wis2.training/oapi?f=html"
},
{
"rel": "self",
"type": "application/geo+json",
"title": "This document as JSON",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=json"
},
{
"rel": "alternate",
"type": "application/ld+json",
"title": "This document as RDF (JSON-LD)",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=jsonld"
},
{
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=html"
},
{
"rel": "collection",
"type": "application/json",
"title": "Discovery metadata",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata"
},
{
"type": "application/json",
"rel": "root",
"title": "The landing page of this server as JSON",
"href": "http://dvila.wis2.training/oapi?f=json"
},
{
"type": "text/html",
"rel": "root",
"title": "The landing page of this server as HTML",
"href": "http://dvila.wis2.training/oapi?f=html"
},
{
"rel": "self",
"type": "application/geo+json",
"title": "This document as JSON",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=json"
},
{
"rel": "alternate",
"type": "application/ld+json",
"title": "This document as RDF (JSON-LD)",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=jsonld"
},
{
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata/items/urn:wmo:md:ar-dvila:reco.surface-based-observations.synop?f=html"
},
{
"rel": "collection",
"type": "application/json",
"title": "Discovery metadata",
"href": "http://dvila.wis2.training/oapi/collections/discovery-metadata"
}
]
}
@maaikelimper maaikelimper added the bug Something isn't working label Sep 19, 2024
@maaikelimper maaikelimper added this to the sprint-016 milestone Sep 19, 2024
@maaikelimper
Copy link
Collaborator Author

maaikelimper commented Sep 23, 2024

@tomkralidis I suspect this issue is caused by the upsert_collection_item called by 'add_token' and 'remove_token' :

upsert_collection_item('discovery-metadata', record)

upsert_collection_item('discovery-metadata', record)

I guess the upsert_collection_item adds links instead of replacing them...

Could we delete/insert instead of upsert ?

@tomkralidis
Copy link
Collaborator

2024-11-21: @tomkralidis to apply fix (and review/inspect in the context of #807).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants