StevonStevoff / ProjectParsnip

A IoT Project for Managing At-Home Smart Farming
3 stars 0 forks source link

Push notifications #92

Closed sc19sjjd closed 1 year ago

sc19sjjd commented 1 year ago

Push notifications via expo-notifications, have only been able to test on iOS as the it only works on physical devices. Has room for some improvements, namely navigating to the plant screen or to the specific plant mentioned but wasn't sure how to do this as the setup is outside of the standard navigation flow. Could potentially move from the navigation root to the bottom navigation tab? This would probably also help so that the app only asks for notification permissions after logging in.

sc19sjjd commented 1 year ago

Tried moving it down to the bottom navigation tab and it didn't prevent the issue from not being logged in so have kept it the same for now.

OHashish commented 1 year ago

Apparently the devices.auth_token and token_uuid are missing from the table sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: devices.auth_token [SQL: SELECT users_1.id AS users_1_id, devices.id AS devices_id, devices.name AS devices_name, devices.model_name AS devices_model_name, devices.auth_token AS devices_auth_token, devices.token_uuid AS devices_token_uuid, devices.owner_id AS devices_owner_id FROM users AS users_1 JOIN user_devices AS user_devices_1 ON users_1.id = user_devices_1.user_id JOIN devices ON devices.id = user_devices_1.device_id WHERE users_1.id IN (?)] [parameters: (1,)]

StevonStevoff commented 1 year ago

Apparently the devices.auth_token and token_uuid are missing from the table sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: devices.auth_token [SQL: SELECT users_1.id AS users_1_id, devices.id AS devices_id, devices.name AS devices_name, devices.model_name AS devices_model_name, devices.auth_token AS devices_auth_token, devices.token_uuid AS devices_token_uuid, devices.owner_id AS devices_owner_id FROM users AS users_1 JOIN user_devices AS user_devices_1 ON users_1.id = user_devices_1.user_id JOIN devices ON devices.id = user_devices_1.device_id WHERE users_1.id IN (?)] [parameters: (1,)]

@sc19sjjd when you fixed the merge conflict with the database did you end up accepting the one from development? That would be the cause of this then as the alembic revision will have been reverted.

Either way, @OHashish try running poetry run alembic upgrade head inside of the backend directory. That should apply the database revision.

OHashish commented 1 year ago

Apparently the devices.auth_token and token_uuid are missing from the table sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: devices.auth_token [SQL: SELECT users_1.id AS users_1_id, devices.id AS devices_id, devices.name AS devices_name, devices.model_name AS devices_model_name, devices.auth_token AS devices_auth_token, devices.token_uuid AS devices_token_uuid, devices.owner_id AS devices_owner_id FROM users AS users_1 JOIN user_devices AS user_devices_1 ON users_1.id = user_devices_1.user_id JOIN devices ON devices.id = user_devices_1.device_id WHERE users_1.id IN (?)] [parameters: (1,)]

@sc19sjjd when you fixed the merge conflict with the database did you end up accepting the one from development? That would be the cause of this then as the alembic revision will have been reverted.

Either way, @OHashish try running poetry run alembic upgrade head inside of the backend directory. That should apply the database revision.

I get this : INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '@head' to narrow to a specific head, or 'heads' for all heads FAILED: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '@head' to narrow to a specific head, or 'heads' for all heads

OHashish commented 1 year ago

Apparently the devices.auth_token and token_uuid are missing from the table sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: devices.auth_token [SQL: SELECT users_1.id AS users_1_id, devices.id AS devices_id, devices.name AS devices_name, devices.model_name AS devices_model_name, devices.auth_token AS devices_auth_token, devices.token_uuid AS devices_token_uuid, devices.owner_id AS devices_owner_id FROM users AS users_1 JOIN user_devices AS user_devices_1 ON users_1.id = user_devices_1.user_id JOIN devices ON devices.id = user_devices_1.device_id WHERE users_1.id IN (?)] [parameters: (1,)]

@sc19sjjd when you fixed the merge conflict with the database did you end up accepting the one from development? That would be the cause of this then as the alembic revision will have been reverted. Either way, @OHashish try running poetry run alembic upgrade head inside of the backend directory. That should apply the database revision.

I get this : INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '@Head' to narrow to a specific head, or 'heads' for all heads FAILED: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '@Head' to narrow to a specific head, or 'heads' for all heads

did you mean heads not head?

StevonStevoff commented 1 year ago

Apparently the devices.auth_token and token_uuid are missing from the table sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: devices.auth_token [SQL: SELECT users_1.id AS users_1_id, devices.id AS devices_id, devices.name AS devices_name, devices.model_name AS devices_model_name, devices.auth_token AS devices_auth_token, devices.token_uuid AS devices_token_uuid, devices.owner_id AS devices_owner_id FROM users AS users_1 JOIN user_devices AS user_devices_1 ON users_1.id = user_devices_1.user_id JOIN devices ON devices.id = user_devices_1.device_id WHERE users_1.id IN (?)] [parameters: (1,)]

@sc19sjjd when you fixed the merge conflict with the database did you end up accepting the one from development? That would be the cause of this then as the alembic revision will have been reverted. Either way, @OHashish try running poetry run alembic upgrade head inside of the backend directory. That should apply the database revision.

I get this : INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '@Head' to narrow to a specific head, or 'heads' for all heads FAILED: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '@Head' to narrow to a specific head, or 'heads' for all heads

EDIT: Wait maybe this is a different issue but give it a try? Per this stack overflow answer, it seems you need to merge them:

https://stackoverflow.com/questions/22342643/alembic-revision-multiple-heads-due-branching-error

poetry run alembic merge head

sc19sjjd commented 1 year ago

@sc19sjjd when you fixed the merge conflict with the database did you end up accepting the one from development? That would be the cause of this then as the alembic revision will have been reverted.

Yeah I might have whoops, but can't fully remember

sc19sjjd commented 1 year ago

@OHashish @StevonStevoff Think the database is now sorted, merged the two migration heads together.

sc19sjjd commented 1 year ago

Ugh

Seems I've broken the frontend