Hi Rick,
I have been playing around with the Message Board App. I thought I would setup two instances of the Message Board App on the same Win7 Test Server. Each has its own virtual, separate folder, separate data files, etc... Everything seems to work fine. However, today I noticed something strange and thought I would run it by you.
On a Win10 Client, I open IE (or Google Chrome) and have one page open to MBInstance1, and another tab/page open to MBInstance2. Been testing for a few days and everything seems fine. Today, I noticed that if I click Reply in MBInstance1, then go to MBInstance2 and click Reply, MBInstance2 shows the ThreadList from MBInstance1. I noticed a similar result if I logout and login on both, MBInstance2 will display the ThreadList of MBInstance1, maybe not every time but at least sometimes.
I just tried another scenario. Logged out of both instances, then logged back in on both, with two different userids. Went to MBInstance1 and clicked Reply on one of the messages. The ThreadList then displayed the data from MBInstance2. It's easy to see this because I have a Pinned message with different Subjects in both message board instances. So, it's very easy to see when the data from the other instance is displayed. I am using VFP tables.
Any ideas on this? When I watch the two Server Web App windows, all of the requests seem to be going to the correct instance. So, I don't know how the data would be getting switched around. Ever seen anything similar?
Thanks!
Steve
Not sure - if you truly have everything in separate virtuals and separate disk folders there should be no cross talk. The instances wouldn't know about each other unless you have common data in the configuration. So whatever crosstalk you get is most likely due to common paths or wrong URLs.
Check your URLs that are causing the issues and I bet you'll find that you're pointing at the wrong URL somewhere.
What version of the Mb are you running? The 6.x version is designed to self-configure (wwThreads_serverConfig.prg) and I know that works because I run different setups locally for testing (running out of a virtual dir wwthreads) and out of a root site in production (support.west-wind.com) - if there were internal URL problems I'd see problems switching back and forth between the deployments I think.
Latest code for the Message board is on Github BTW.
https://github.com/RickStrahl/West-Wind-Message-Board
+++ Rick ---
I think I downloaded the Mb instance from GitHub about a year ago.
I did use the wwThreads_serverConfig.prg, but must have something crossed up somewhere. I'll dig around a bit and see what I can find.
As always, thanks!
Steve
Hmmm, it seems I only have the issue when I have two tabs open in the browser, one accessing Mb1 and the other access Mb2. When I am accessing only one instance, I never get any cross talk. Is there anything local (some kind of cache maybe) that might have an affect?
If it's a url or path issue, wouldn't that happen even when there's only one page/tab open???
Thanks,
Steve
Yes that's because both instances use the same cookie. You'll need to make sure each instance uses a different cookie.
This line:
THIS.InitSession("wwt",24000 * 30,.T.)
needs a different key for each app in wwThreadProcess.prg
.
Yep, I bet that's it! Makes sense. I'll see if I can adjust the cookie value based on the virtual or something.
Thanks Rick!
Would this approach work, or would it possibly lead to issues? Might it lead to problems in other areas? I tried it and it seems to work, but then IE seems to have lost the CSS Formatting. Not sure if changing this line caused it or not. I changed it back, but IE is still not displaying correctly. I fired up Chrome and it looks normal, but I did not try the change with Chrome.
THIS.InitSession(THIS.cUrlBasePath,24000 * 30,.T.)
Thanks,
Steve
That might work but it's a bad idea because it makes cookie parsing more difficult. It's probably better to just pick up the virtual path from the configuration:
lcVirtual = STRTRAN(this.oConfig.cVirtualPath,"/","")
Session.InitSession("wwt_"+ lcVirtual,24000 * 30,.T.)
Note that if you use separate Web Sites (ie. separate domains or subdomains) the cookies will be separated without requiring any special handling, so that's probably the best approach (ie. support.west-wind.com, helpdesk.west-wind.com etc.)
+++ Rick ---
Perfect, very easy and I appreciate the feedback.
Steve
Hi Rick,
I made the change you suggested and built a new .Exe (Web Server App).
It's been about a year since I built this originally, but I applied an update once before and I think all I had to do was copy over the new .Exe onto the server.
This time, when I place the new .Exe on the server, it starts just fine. When I try to bring up the initial page from a client browser, the Msgboard Web App Server throws the following error:
loBuilder is not an object
Any idea what can be causing this? I don't think anything changed other than the one line, but I don't think that one line is the issue. I tried building the new .Exe from two different dev machines, one using WWWC v6.10 and one using v6.18. Both gave the same result. I'm sure I'm missing something. I think I also tried changing the INITSession line back to original, and still got the loBuilder error. So....., a little stumped.
TIA,
Steve
I'm not sure what loBuilder
is. I don't think that's anything from Web Connection or the message board...
+++ Rick ---
Hmmm... actually it turns out it's the Markdown parser.
Make sure you update your DLLs for the latest Web Connection installs - in the deploy
folder. I changed Markdown Libraries after 6.10 I believe. Specifically you'll need the Markdig.dll
assembly in your startup folder. But whatever you do, you need to have all the DLLs from the Web Connection install and I recommend updating them all.
+++ Rick ---
That was it! Thanks for pointing me in the right direction. Going through this process is helping me understand all the tasks involved with setting up and deploying a WWWC App. Plus, I am using the Message Board App to gain a better understanding of how WWWC Apps work. There's a lot to learn of course, good thing I love this stuff!!
I will check the other dll's as you suggest.
Thanks again,
Steve
One other question, it was working before. Was that because it was using CommonMark.dll?
I noticed CommonMark.dll is not in the \WConnect folder of the latest release. Is CommonMark.dll now deprecated?
Steve
I implemented the InitSession change, but it looks like I am still getting some cross-talk. It appears it only happens with the first message title in the left panel, and only when I have two tabs open, one to each message board, and I click the Refresh button on the browser. When I click Refresh within the Message Board App, it displays properly.
Both of these "Test" Websites are setup as Virtuals under the Default Website on a Win10 Pro system. One virtual is Msgboard and the other is Msgboard2. Perhaps the virtual names are too similar. You mention using subdomains, and that's probably the next step unless you have another suggestion on making the current configuration work (with the two virtuals under the default website). And maybe the two virtuals under the default website is not a good idea, I ask your opinion on that.
Of course, the whole point of this is mainly for my own education, and to figure out how I can make this work. I do hope to have at least two instances of the Message Board App that I will use to support customers, and possibly more than 2 instances in the future. It is possible that a given user would be accessing both message boards at the same time. So, my goal is to workout the details of how best to implement multiple message boards, preferably on the same server. This includes everything from A to Z, IIS Configuration, Website Config, URL Forwarding, and along the way educate myselft on how a WWWC MVC Web App works (frontend and backend)!
Thanks for all your help and for sharing your knowledge and tools!
Steve
Hmmm... yes now that I think about it, the message board also stores the message list in localstorage
on the client and that data too is site specific.
So I think you're right - the only way to get the message board to work this way is by using separate domains (or subdomains) so that cookies and localstorage are isolated. I suppose the code could be changed to make the local storage key specific to the virtual/or site, but that might have other side effects.
+++ Rick ---