how to maintain current state of the web application when refreshed and not navigate to the starting page? - state

I am new to web development. I have few requirements for a web application.
I have two Qualtrics surveys and the flow of the application is that a user lands on the first survey and upon completing it gets redirected to a chat room and then to the second and final Qualtrics survey. The whole flow is also created as a task for workers on the Amazon Mechanical Turk.
When a user refresh the first survey(in any of the 4 pages of the first survey), it maintains the current state as well as the selected answers and it doesn't navigate back to the Introduction page of the first survey. But when a user refreshes from the final survey, it lands the user on the Introduction page of the first survey. It only happens when I deploy the whole flow into Amazon Mechanical Turk. When I test the whole flow without deploying on Mechanical Turk, it doesn't redirect the user to the first survey upon refresh and behaves as intended.
As far as I can understand Mechanical Turk must be overriding the Qualtrics way of maintaining the page state. Now I am unable to figure out how to solve this. I can only use Qualtrics JS API to solve this but if MTurk is causing the issue, it won't do any good. Any suggestions on what might be the issue and how to solve this?

Related

How to avoid data duplication in a microservice architecture

I am learning about microservices and I get very confused when it comes to data duplication. From different sources on the internet I get very different opinions on the subject, but the main conclusion that I got is that it depends if it's good on your use case or application.
Now I am struggling because I am trying to make a very simple microservice where I think data duplication is not necessary, but can't seem to think of a good alternative to it.
My Application
I am basically making a Twitter clone to understand the basics of microservices using AWS. To start I have 3 services:
Timeline Service
Post (or tweet) Service
Follow Service
Timeline service
The timeline service should return the timeline of the user that asked it. It should check who the user is, that requests his/her timeline is following, get the 100 most recent posts from those users and return it to the user (that requested his/her timeline)
Posts/tweet Service
When a user is posting a new tweet/post, the post timeline should save the post in the post database to keep track of who posts what.
Follow Service
When a user wants to follow another user the follow service should keep track of that.
If I put it into an image it would look like this:
The problem
My question is about the timeline service. Should the timeline
Have two (in memory) databases that also keep track of who follows who and who posts which tweets to give the user quickly their timeline back
Or should the timeline service call the different services to get that information?
The 'bad' thing from the last option would be that if my posts service is failing and can't send or receive requests, my timeline service also does not work and you create dependency which goes against microservice principles.
Since the last option seems the worst one to me, I would say data duplication is the better option because of response time and to keep the different services from relying on each other.
Can anyone help me to get on the right track with this problem?

Facebook developers applications review

We have created an application to allow our clients to go live on facebook.
We have submitted the application for review but we haven't received any feedback from facebook yet. it has been more than a month since we submitted the app for review. is there anything we can do to accelerate the process?
it has been more than a month since we submitted the app for review. is there anything we can do to accelerate the process?
No, there is not - it’s first come, first serve.
https://developers.facebook.com/docs/apps/review/faqs#faq_981925055227977 says:
Due to changes to the review process and the high volume of submissions expected, it may take several weeks for submitted apps to complete review.

App not getting data from Graph API anymore & problems filling out for review

Take a breath... it's a very specific question, not directly a bug.
(But I can't get an answer from Facebook, after thousands of FAQ pages I somehow landed in a chat with Facebook Advertisers Support, they told me to come here.)
Description of my app
I have a Facebook Page, on which I'm sharing events from some other Facebook Pages I'm cooperating with. Kind of an event aggregator. The main goal is to help people who are new in town to find all that interesting events and the groups and pages they are organized by.
As you can imagine, it's based on a server-side application, that collects the upcoming events through Graph API and posts on my own Facebook Page the day before the event.
Of course I had to give the server-side application the manage_pages and publish_pages right. This Facebook App will never be used by an end-user, I'm the only user and I'm only posting to my own Facebook Page.
The server-side application worked fine for more than a year.
I just started a Facebook Ad Campaign and poster and flyers are currently being printed. And now...
What broke
You all heard of Cambridge Analytica. Due to these bad guys Facebook is currently changing a lot. One change was this:
As we begin enhancing our new app review process and make changes to our platform, the Events, Groups, Pages and Instagram APIs will no longer be available to new developers. Testing of our more robust process starts today and the new process should resume in a few weeks, but apps currently accessing Events and Groups APIs will lose access today. Going forward, access to these APIs will require a formal app review and for apps using the Pages API, submission is required within 90 days once app review resumes or access will be removed.
(See https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes)
Since nearly two weeks my server-application can't fetch events. Graph API is always returning an empty array data: [].
I have full understanding for this. Now I tried to follow these new requirements and had a look on how to submit my App for review. But that's where my struggles began:
The specific problem
The whole form for applying for review is aimed to Apps for end-users, not server-side bots.
I should provide details on why I'm using manage_pages or publish_pages. Well okay...
When selecting "automated posting" there immediatly a message pops up, telling me, that this is not allowed. Of course it is not - for applications that post in the name of persons without their knowing and aggreement. But my App is posting in the name of my own Facebook Page and I'm the only user and I'm knowing what's going to be posted. So I have to select "Other" and enter a custom description. No problem.
But at the end of the form there's asked for a Screencast! What should I make a movie of? Should I make a slideshow of my code? I can't save this form without that Screencast.
I want to be conform to the new Facebook processes, but I simply don't know how to become approved nor at least fill out for review...
I know this is not a programming question but Facebook directed me here.
So I hope I find a Facebook official or Facebook developer here. Thank you so far!

How to insert timeline card in new user account for first time

I've followed the Glass quick start guide for Glass for Python.
I'm able to run the server locally and can insert timeline cards to my account using the Admin Panel in Quick Starter. So far so good. But how the flow would look like for a new user? I'm creating a glassware similar to weather updates. In Quick starter, I had to trigger the "post" thru a "form" element. How does it work when someone installs Glassware from store. What triggers that person to get "very first" timeline card. I'm quite confused here. Any useful information will be helpful.
When a user turns on your Glassware in MyGlass, they will be redirected to your auth URL and taken through an OAuth flow (just as would happen if you visit that URL manually without going through MyGlass when you're developing). After they go through that authorization, you can perform any post-auth tasks that you need, such as inserting contacts or timeline items.
The relevant code in the Python Quick Start can be found in the _perform_post_auth_tasks method of the OAuth request handler, which is called at the end of the get request before redirecting to the Glassware's main page.

Sitecore: tracking of the last visited page

On the site that I'm developing we need to track the last visited page for each user (users login to the site). What's the best way to do this? We are already using a custom profile so adding a new field is easy. The site will not have a lot of traffic so updating this field wont be an issue, i think. Are there better ideas? Does sitecore already offers something that we can possible use?
OMS has a "Top Exit Pages" report by default... but that is tracked across sessions, not users.
A good IIS log parser should also be able to give you this information... again, that would be by session (or IP) and not logged in user.
If you really want to get every exit page AND filter by logged in user... what I would do is add a new pipeline processor to httpRequestBegin, and place it after the ItemResolver. Then save the Item.Paths.Path. I would advise against writing this data to the user Profile if you are using the default ASP.NET Profile handler and you have a decent amount of traffic, because it is highly inefficient. Roll your own simple storage solution here, or just dump the data to a log.
My first question would be: Why do you need only the last visited page of the user? What are you trying to determine?
In a lot of cases, you are probably starting down an analytics route, or perhaps even trying to drive some marketing.
If the analytics is what you are going for, you can probably just pop an event out to your google analytics account with the current username as an event variable to allow you to look at analytics by user and by page. Alternatively, you could use the Sitecore OMS/DMS features for tracking all that data and looking at the analytics there.
If you are looking at driving marketing, you probably want to use OMS/DMS, especially if you want to start getting into personalization or engagement plans. OMS/DMS will track user activity, and all the pages they visit, though not by user account. With some customizations, you can probably add that data in, but it will depend on what you are trying to use the information for. The username may not be what is important to you.
If, however, you just want to know what page to send the user back to after logging them in, it would be better to just store that in session or pass as a post parameter if session is not a viable option for you.