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

ToC refresh - New issue #1750

Open
jasonjac2 opened this issue Jan 3, 2025 · 8 comments · Fixed by #1752
Open

ToC refresh - New issue #1750

jasonjac2 opened this issue Jan 3, 2025 · 8 comments · Fixed by #1752
Assignees
Labels
bug Something isn't working next-release Addressed but not yet released

Comments

@jasonjac2
Copy link

jasonjac2 commented Jan 3, 2025

Problem to Solve

ToC doesn't refresh and also it doesn't actually tell you it failed, i.e. a swallowed exception, rather than a "I tried, I failed."

I haven't started diagnosing yet, i.e. cutting page up, but it obviously worked a few days ago as the last dated item int eh ToC = 31/12/2024 and there is one entry other than the one it failed on.

Screen grab of contents to show what I was looking at.
image

Screen grab of ToC that won't update

image
URL of the refresh - looks fine to me.
onemore://InsertTocCommand/refresh/here/style0

Any clues?
In terms of reading this, it doesn't actually say what the exeption is, so I assume it is a custom one you are throwing?
Also: --- End of stack trace from previous location where exception was thrown ---
how do I read this? I get the top stack trace, but how do the other 2 relate to the top one?
TIA
Version 6.7.1 with OneNote 16.0.18227.20162

21|11:47:43.147| Invoking command InsertTocCommand
21|11:47:43.657| ..refresh toc for page OneMore 2022 -
21|11:47:43.658| ..error wrapping /03/01/2025 New release 6.7.1 - bug fix & installed on /
18|11:47:43.658| ..error refreshing table of contents
System.Xml.XmlException
Message: An error occurred while parsing EntityName. Line 1, position 48.
Source: System.Xml
StackTrace: at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
at System.Xml.XmlTextReaderImpl.FinishPartialValue()
at System.Xml.XmlTextReaderImpl.get_Value()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XElement.ReadElementFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
at River.OneMoreAddIn.Extensions.ToXmlWrapper(String s, String name)
at River.OneMoreAddIn.XCDataExtensions.GetWrapper(XCData cdata)
at River.OneMoreAddIn.Commands.Snippets.TocGenerators.PageTocGenerator.g__RemoveHyperlinks|14_0(String text)
at River.OneMoreAddIn.Commands.Snippets.TocGenerators.PageTocGenerator.BuildHeadings(XElement container, List1 headings, Int32& index, Int32 level, Boolean dark) at River.OneMoreAddIn.Commands.Snippets.TocGenerators.PageTocGenerator.BuildHeadings(XElement container, List1 headings, Int32& index, Int32 level, Boolean dark)
at River.OneMoreAddIn.Commands.Snippets.TocGenerators.PageTocGenerator.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at River.OneMoreAddIn.Commands.Snippets.TocGenerators.PageTocGenerator.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at River.OneMoreAddIn.Commands.Snippets.TocGenerators.PageTocGenerator.d__17.MoveNext()
TargetSite: [System.Xml] System.Xml.XmlTextReaderImpl::Throw()

@jasonjac2 jasonjac2 added bug Something isn't working unread I have seen it or had time to refine it yet labels Jan 3, 2025
@jasonjac2
Copy link
Author

I had another page that had the same issue and got someone else to try it and it worked as expected (updating the ToC) and they were using 6.5.0
Anything I can do to help?

@stevencohn
Copy link
Owner

Remove the &
I'll take a look and I'm not sure yet but I imagine that would have made it fail in past versions too?

@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Jan 3, 2025
@stevencohn
Copy link
Owner

And yeah, I've been ignoring that redraw issue on the Context Menu sheet

@jasonjac2
Copy link
Author

jasonjac2 commented Jan 3, 2025

Main issue: yep, I was just coming back here to report it is the "&" as I have a few cases that barf at that.
I hadn't noticed in previous version.

If it fails, why doesn't it tell you it failed?
Because some of my ToCs take a while to update the page, i tend to click the refresh then do something else non ON related for a minute or so, so I wouldn't realise it had failed.

The redraw thing, did you want a bug report for the places I notice it or is it something you know where it occurs (I also saw it on the calander a while back), possibly a few others.

@stevencohn
Copy link
Owner

It doesn't tell you it failed because "why the heck would it fail!?" ;-) OM needs better error reporting all around.

Sure, create a ticket. Make me fix it.

@jasonjac2
Copy link
Author

No pressure, but in terms of fix, are we looking next release (e.g. in a couple of months)?
If that is the kind of timeframe I can remove the &'s as I need to refresh ToC's, if a lot shorter I'll hold fire.
Cheers, JAC.

@stevencohn
Copy link
Owner

I'll release a patch next week

@jasonjac2
Copy link
Author

you ⭐

stevencohn added a commit that referenced this issue Jan 3, 2025
stevencohn added a commit that referenced this issue Jan 3, 2025
@stevencohn stevencohn self-assigned this Jan 3, 2025
@stevencohn stevencohn added the next-release Addressed but not yet released label Jan 3, 2025
@stevencohn stevencohn linked a pull request Jan 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next-release Addressed but not yet released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants