KenDB3 / syncWXremix

Weather application/external program (door) written in javascript for Synchronet BBS
ISC License
9 stars 7 forks source link

Pulls data for previous login, not current login? #6

Closed JHiemenz closed 8 years ago

JHiemenz commented 8 years ago

When running syncWX as a 'logon' event, Has anyone else encountered or reported displaying information from a previous login? I can reproduce this at will by connecting from two different locations.

Client A is in Minnesota, Client B is in Wisconsin, Synchronet Server is in Toronto. I will typically connect from client B, and SyncWXremix will display weather for 'wisconsin'. If I then connect from client A in minnesota, syncWXremix displays weather for 'wisconsin'. I will then connect from client B again, and syncWXremix displays weather for 'minnesota'.

It seems like the code is not getting the 'current IP', but a previous IP, when doing the lookup. Is the code relying on it's own lookups or pulling the IP info from Synchronet data stores? If pulling from Synchronet, I suspect Synchronet has not written the users current IP at this point. If I run the syncWX from the external progs menu after the login event, it displays correct info.

KenDB3 commented 8 years ago

Hi there! I know exactly what you are talking about. Even before I made my first commit on GitHub, I had found this problem. I log in from work sometimes, and my work's IP, while physically in RI, exits the network in our VA office. So, I would see the behavior you are talking about.

It has more to do with Synchronet than the syncWXremix script. I reported it to digital man. --> My Post and he responded --> DM's Response

digital man made a fix in the CVS code. However, the fix requires you to make (linux) or grab (windows) a new build of Synchronet, or at least a build that is after Dec 16 2015 12:13 am PST.

Here is the relevant CVS info:

CVS Commit for the fix

rswindell Wed Dec 16 2015 12:13 am PST

Modified Files: src/sbbs3/answer.cpp 1.89 1.90 diff src/sbbs3/logon.cpp 1.61 1.62 diff

Log Message: Fix bug reported by KenDB3: The JS-modeled user object's ip_address and host_name property values did not reflect the current connection during logon events (JS modules executed during logon, e.g. logon.js). Moved the initialization of the current user (sbbs_t::useron) ipaddr and comp field to sbbs_t::logon() rather than when control returns to sbbs_t::answer(). Removed the (now) redundant saves of these user fields from answer().


You have reminded me, however, that an FAQ about things like this would be a good idea.

Thanks for the report!

~Kenny

KenDB3 commented 8 years ago

I added some FAQs to help address this and a few other things. I'm going to mark this one as closed.