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

Possible Caching with multiple tex views on one page #43

Closed
JosephShepin opened this issue May 9, 2020 · 17 comments
Closed

Possible Caching with multiple tex views on one page #43

JosephShepin opened this issue May 9, 2020 · 17 comments

Comments

@JosephShepin
Copy link

Hi,
I have noticed that if you have multiple tex views, initially both views render what's given to them, however after you alter one of them using "setstate" and then alter another, it doesn't render what was given to it, but instead what the previous texview displayed. To show you this, I made a video, there is a text view to display the input to the tex view directly over the tex view. both are given the same variable input, but after a bit, you will see things don't match up. I made a clear video explaining this so I hope you can better understand. Thanks

https://drive.google.com/file/d/10W3EDsEjFtSjgaAOnEfliBBV6xXJTHFP/view?usp=sharing

Text(f), TeXView( showLoadingWidget: true, renderingEngine: TeXViewRenderingEngine .katex(), children: [ TeXViewContainer( children: [ TeXViewTeX( f, style: TeXViewStyle( backgroundColor: dark ? Color( 0xff2f3136) : Colors .white, contentColor: dark ? Colors .white : Colors .black, ), ) ], ), ],

@shah-xad
Copy link
Owner

shah-xad commented May 10, 2020

Which version of flutter_tex are you using? This was an issue in the previous versions but this has been resolved.

@JosephShepin
Copy link
Author

Latest (^3.6.1) :)

@shah-xad
Copy link
Owner

Can you share your code from the video??

@JosephShepin
Copy link
Author

Its a lot of code, I'm giving you the page of it shown in the video, there is data coming from databases and such, I'm not sure it will help you. As you saw in the video, the text views and the tex views would become misaligned, and that is demonstrated around line 220, which shows the text input and the tex output as i detailed in the video. I hope this helps.

https://pastebin.com/8LxLg3GE

@shah-xad
Copy link
Owner

Sorry, but I couldn't get the issue from your code. How to reproduce this issue? Can you show a minimal example of this issue?

@JosephShepin
Copy link
Author

I built a minimal example, however, I wasn't able to replicate the issue. I will do further testing and try to get to the bottom of this. Thank you for your response. In case your wondering, this is what I wrote to test, It doesn't follow the exact structure of my app, but I thought it would cause the issue I was facing, it didn't :( https://pastebin.com/zXRjaGPz

@shah-xad
Copy link
Owner

shah-xad commented May 10, 2020

In your previous code, I found only 1 TeXView. but in the video, there are 3. Can you explain this, please? i.e. Are you using a custom widget of TeXView, without creating separate instances?

@JosephShepin
Copy link
Author

JosephShepin commented May 10, 2020

In the original code shown in the video, i was using a listview builder which generated them one after another, in my test code, i just manually copy and pasted a few in their,

@JosephShepin
Copy link
Author

JosephShepin commented May 10, 2020

I found an ipad running an older version of my app using tex version ^3.1.3+5, and it ran basically the same code (for that specific screen) back then, compared to what i have now shown in my video. I do not experience any issues with the caching in that version of the app. The only change for the screen since was to adapt the update regarding css styling. I don't know how if anything this helps things, but my code really hasn't changed since that update. For the time being, I might revert back to that version

@shah-xad
Copy link
Owner

Please post your debug info when you open this particular page.

@JosephShepin
Copy link
Author

JosephShepin commented May 10, 2020

output when entering the problematic page, this is output from my Samsung s8 https://pastebin.com/0hafWdR9

this is output from pixel 3 emulator https://pastebin.com/cHkXbhnz

@shah-xad
Copy link
Owner

shah-xad commented May 10, 2020

output when entering the problematic page, this is output from my Samsung s8 https://pastebin.com/0hafWdR9

this is output from pixel 3 emulator https://pastebin.com/cHkXbhnz

It should work according to this output. Let me do my own testings. can you provide your EquationGroup class?

@JosephShepin
Copy link
Author

class EquationGroup { //a group of multiple equations in terms of eachother List<String> equations; List<String> varibles; EquationGroup(this.equations, this.varibles); }

@shah-xad
Copy link
Owner

Please try with the latest version flutter_tex: ^3.6.1+1. I tried to include older system where it was working fine for you. But that has limitations that won't support data characters more than 2000 and automatically shift to the new system. please check and let me know.

@JosephShepin
Copy link
Author

ok, so running the app with the debugger runs and after pressing a few buttons on the problematic page to change the view, the error "Exception has occurred.
SocketException (SocketException: Failed to create server socket (OS Error: The shared flag to bind() needs to be true if binding multiple times on the same (address, port) combination.), address = localhost, port = 53560)" comes up. however, if i reopen the app installed on the device, the no issues occur, and it works perfectly fine, no caching at all. Here is the output when running in debug mode https://pastebin.com/PhT7p4PD . So to recap, the debugger gives that error when in debug, however if I just open the app afterward, no issues. I rebooted my computer to make sure their were no servers running on my machine that could conflict. Thanks

@shah-xad
Copy link
Owner

Please try with flutter_tex: ^3.6.1+2.

@JosephShepin
Copy link
Author

Works like magic - Thanks so much

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

No branches or pull requests

2 participants