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

Silent failing of addAnnotations with "old" version of Hub Annotations #430

Closed
lisastaehli opened this issue Nov 30, 2020 · 7 comments · Fixed by #453
Closed

Silent failing of addAnnotations with "old" version of Hub Annotations #430

lisastaehli opened this issue Nov 30, 2020 · 7 comments · Fixed by #453
Assignees

Comments

@lisastaehli
Copy link

We have received a bug report for Urban where a user was unable to add an annotation. We identified that the problem was that the ArcGIS Online organization of the user had an older version of the Hub Annotations layer where public annotations (Author = NULL) was not yet allowed by the schema (see error message below).

Old_Annotations_Layer (1)

Of course there is an obvious workaround to this (probably) edge case: the user has deleted the old annotations layer (which was anyway empty) & added a new one with the current schema.

We would like to start a discussion on how to handle old versions of Hub Annotations layers with HubJS. In my opinion, there would be a few things that could be nice, e.g. notify the user if they are trying to connect to a feature service with an outdated schema and/or (automatically) migrate in this case.

Please note that we are currently still on version 2.2.4 of Hub JS. If this is handled in a newer version, please let me know :)

@lisastaehli
Copy link
Author

@tomwayson any thoughts on this :)?

@ajturner
Copy link
Member

ajturner commented Dec 8, 2020

two approaches to consider / provide estimates @tomwayson

  • adding a migration function (I recall there was one before)
  • throwing exception when creating annotation fails.

@tomwayson
Copy link
Member

I'm looking into a migration script.

In the mean time, a potential quick fix for this would be to see if the existing service has zero records, and if so, just remove it and call createAnnotationService().

@tomwayson
Copy link
Member

I see you already did that. 🤦

@tomwayson
Copy link
Member

tomwayson commented Jan 5, 2021

FYI - this is the underlying issue regarding how the errors are swallowed:

Esri/arcgis-rest-js#790

I think I'll have the rest-js functions throw an error if all records have an error. We could go a step further and have addAnnotations() and updateAnnotations() throw an error if any records failed.

Let me know if you think the latter is necessary.

@lisastaehli
Copy link
Author

@tomwayson thanks for the update.

I think all having errors serves our purposes as an outdated schema will cause all of them to fail :)

tomwayson added a commit that referenced this issue Jan 19, 2021
affects: @esri/hub-annotations

ISSUES CLOSED: #430
tomwayson added a commit that referenced this issue Jan 20, 2021
affects: @esri/hub-annotations

ISSUES CLOSED: #430
tomwayson added a commit that referenced this issue Jan 20, 2021
affects: @esri/hub-annotations

ISSUES CLOSED: #430
@tomwayson
Copy link
Member

@lisastaehli this has been released as 6.22.3

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.

3 participants