sparkletown / sparkle

Building an open, community-owned hyperverse town
GNU Affero General Public License v3.0
33 stars 30 forks source link

poll: can't submit answer from local dev instance - expected? #1495

Closed yarikoptic closed 3 years ago

yarikoptic commented 3 years ago

I was trying to add markdown rendering for Poll to go in #1383 (attn @margulies , yet to pushed to that PR), for that I had added a poll on the main OHBM page (on https://ohbm.sparkle.space/in/home logged in as Y.Halchenko) and then went to local instance on http://localhost:3000/in/home where I am logged in as Yarik, but when I tried to click on :+1: button (rendered nicely with markdown BTW) I am thrown into debugger, I switched back to staging where the poll looks like

image

and tried again to click on :+1: and console has

service.ts:160 POST http://localhost:5001/sparkle-ohbm/us-central1/venue-voteInPoll net::ERR_CONNECTION_REFUSED
the stack ```shell (anonymous) @ service.ts:160 step @ tslib.es6.js:100 (anonymous) @ tslib.es6.js:81 (anonymous) @ tslib.es6.js:74 __awaiter @ tslib.es6.js:70 Service.postJSON @ service.ts:151 (anonymous) @ service.ts:216 step @ tslib.es6.js:100 (anonymous) @ tslib.es6.js:81 fulfilled @ tslib.es6.js:71 Promise.then (async) step @ tslib.es6.js:73 (anonymous) @ tslib.es6.js:74 __awaiter @ tslib.es6.js:70 Service.call @ service.ts:192 (anonymous) @ service.ts:140 voteInVenuePoll @ chat.ts:137 (anonymous) @ useVenuePoll.ts:25 (anonymous) @ ChatPoll.tsx:66 onClick @ ChatPoll.tsx:81 callCallback @ react-dom.development.js:188 invokeGuardedCallbackDev @ react-dom.development.js:237 invokeGuardedCallback @ react-dom.development.js:292 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:306 executeDispatch @ react-dom.development.js:389 executeDispatchesInOrder @ react-dom.development.js:414 executeDispatchesAndRelease @ react-dom.development.js:3278 executeDispatchesAndReleaseTopLevel @ react-dom.development.js:3287 forEachAccumulated @ react-dom.development.js:3259 runEventsInBatch @ react-dom.development.js:3304 runExtractedPluginEventsInBatch @ react-dom.development.js:3514 handleTopLevel @ react-dom.development.js:3558 batchedEventUpdates$1 @ react-dom.development.js:21871 batchedEventUpdates @ react-dom.development.js:795 dispatchEventForLegacyPluginEventSystem @ react-dom.development.js:3568 attemptToDispatchEvent @ react-dom.development.js:4267 dispatchEvent @ react-dom.development.js:4189 unstable_runWithPriority @ scheduler.development.js:653 runWithPriority$1 @ react-dom.development.js:11039 discreteUpdates$1 @ react-dom.development.js:21887 discreteUpdates @ react-dom.development.js:806 dispatchDiscreteEvent @ react-dom.development.js:4168 ```

so smells like system considers me not logged in or smth like that... so I logged out, logged in, saw

ice6.somafm.com/secretagent-128-aac:1 GET https://ice6.somafm.com/secretagent-128-aac net::ERR_CONNECTION_RESET

in the console, clicked on :+1: and got the same error as before.

I have tried to submit a new poll from the local instance but got

chat.ts:138 Uncaught (in promise) Error: internal
    at new HttpsErrorImpl (error.ts:65)
    at _errorForResponse (error.ts:175)
    at Service.<anonymous> (service.ts:231)
    at step (tslib.es6.js:100)
    at Object.next (tslib.es6.js:81)
    at fulfilled (tslib.es6.js:71)

so again suggesting that something is funky about login for the purpose of the Poll from a local dev instance?

edit: FWIW -- I did try poll yesterday and it worked - but I don't remember in which instance I had submitted and in which voted... and then I removed that poll to "not clutter" (should have kept)

yarikoptic commented 3 years ago

wise @margulies pointed out that local dev instance goes over http and not https -- might relate? (but then -- all other features work just fine AFAIK)

0xdevalias commented 3 years ago

and tried again to click on :+1: and console has

service.ts:160 POST http://localhost:5001/sparkle-ohbm/us-central1/venue-voteInPoll net::ERR_CONNECTION_REFUSED

@yarikoptic @margulies Off the top of my head, this looks like you're not running the firebase function emulators during local dev, which is failing as I believe this feature calls a backend function.

See the documentation about this in the README:

tl;dr: npm run firebase:emulate-functions


I have tried to submit a new poll from the local instance but got

chat.ts:138 Uncaught (in promise) Error: internal

@yarikoptic Usually when you get 'Error: internal' it relates to a firebase backend function, as that is the default response it returns for unhandled errors. If it's a real backend error, then you would usually be able to find the details about it in the corresponding function's logs in the firebase admin console.

mobilevinay commented 3 years ago

local environment issue...

yarikoptic commented 3 years ago

Yeah, must have been no emulators etc