The following thread issues seems to be reproduced in the current version.
It seems that uploadAttachment and applyEditsUsingAttachmentFirst methods are called when the attachment is enabled, but the token resetting process is not implemented.
The applyEditsUsingFeatureFirst method implements error handling when there is no token.
Is there any plan to fix the source code?
Are you able to share the feature layer that you are using? It sounds like this is a bug, and I think for something like this, it is best to work Esri Technical Support, so that we can get it triaged and submitted properly.