neopostmodern / wohnungsbot

Der Wohnungsbot — die Anwendung zum 2. Akt ("Das Versprechen des Bots") des Automatisierungsdramas in drei Akten "Von einem der auszog eine Wohnung in Berlin zu finden" von Clemens Schöll
https://wohnungsbot.de
GNU Affero General Public License v3.0
150 stars 27 forks source link

logout doesn't work #148

Closed hoelger closed 1 year ago

hoelger commented 1 year ago

recreate with:

error pops up multiple times:

isElementInViewport(.topnavigation__overlay--account) called on non-existent element
Error executing JavaScript-snippet within webContents:
[TypeError] Cannot read properties of null (reading 'scrollIntoView')
TypeError: Cannot read properties of null (reading 'scrollIntoView')
    at <anonymous>:3:77
    at new Promise (<anonymous>)
    at <anonymous>:1:1

This is the code that caused the error:
new Promise((resolve, reject) => {
       try {
          resolve(document.querySelector('.topnavigation__overlay--account').scrollIntoView({ behavior: 'smooth', block: 'nearest'}))
       } catch(err) {
          throw { name: err.name, message: err.message, stack: err.stack }
       }
    })
// END OF CODE

Stack that led to the execution of this snippet (Electron):
 at shadowRootSelector (/home/georg/Mega/Projekte/wohnungsbot/wohnungsbot/app/webpack:/wohnungsbot/app/actions/botHelpers.js:154:25)
 at focus (/home/georg/Mega/Projekte/wohnungsbot/wohnungsbot/app/webpack:/wohnungsbot/app/actions/botHelpers.js:219:7)
 at resumeValue (/home/georg/Mega/Projekte/wohnungsbot/wohnungsbot/app/webpack:/wohnungsbot/app/actions/botHelpers.js:32:19)
 at promiseReturnValue (/home/georg/Mega/Projekte/wohnungsbot/wohnungsbot/app/webpack:/wohnungsbot/app/utils/generators.js:19:9)
 at /home/georg/Mega/Projekte/wohnungsbot/wohnungsbot/app/webpack:/wohnungsbot/app/utils/async.js:12:13
hoelger commented 1 year ago
hoelger commented 1 year ago

First draft is solving this by calling 'https://sso.immobilienscout24.de/sso/logout?sso_return=https://www.immobilienscout24.de'

Other option would be to navigate to 'https://www.immobilienscout24.de/geschlossenerbereich/start.html?source=headericon' (as done for logging in) and then click 'Abmelden' at the bottom

hoelger commented 1 year ago

minor remaining thing: the bot message "Abmelden" gets interrupted two times and then "Website lädt..." appears. Might be technically correct, but just by appearance its looks flaky